squad-kit 1.3.19 → 1.3.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,741 @@
1
+ (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function s(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=s(i);fetch(i.href,a)}})();function Uf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ep={exports:{}},No={},Ap={exports:{}},Be={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Ry;function s8(){if(Ry)return Be;Ry=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function x(B){return B===null||typeof B!="object"?null:(B=p&&B[p]||B["@@iterator"],typeof B=="function"?B:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,k={};function b(B,ee,O){this.props=B,this.context=ee,this.refs=k,this.updater=O||g}b.prototype.isReactComponent={},b.prototype.setState=function(B,ee){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,ee,"setState")},b.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function w(){}w.prototype=b.prototype;function S(B,ee,O){this.props=B,this.context=ee,this.refs=k,this.updater=O||g}var T=S.prototype=new w;T.constructor=S,j(T,b.prototype),T.isPureReactComponent=!0;var E=Array.isArray,z=Object.prototype.hasOwnProperty,$={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function L(B,ee,O){var ke,pe={},xe=null,Te=null;if(ee!=null)for(ke in ee.ref!==void 0&&(Te=ee.ref),ee.key!==void 0&&(xe=""+ee.key),ee)z.call(ee,ke)&&!P.hasOwnProperty(ke)&&(pe[ke]=ee[ke]);var Ee=arguments.length-2;if(Ee===1)pe.children=O;else if(1<Ee){for(var Fe=Array(Ee),Ge=0;Ge<Ee;Ge++)Fe[Ge]=arguments[Ge+2];pe.children=Fe}if(B&&B.defaultProps)for(ke in Ee=B.defaultProps,Ee)pe[ke]===void 0&&(pe[ke]=Ee[ke]);return{$$typeof:e,type:B,key:xe,ref:Te,props:pe,_owner:$.current}}function W(B,ee){return{$$typeof:e,type:B.type,key:ee,ref:B.ref,props:B.props,_owner:B._owner}}function F(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function U(B){var ee={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(O){return ee[O]})}var I=/\/+/g;function D(B,ee){return typeof B=="object"&&B!==null&&B.key!=null?U(""+B.key):ee.toString(36)}function M(B,ee,O,ke,pe){var xe=typeof B;(xe==="undefined"||xe==="boolean")&&(B=null);var Te=!1;if(B===null)Te=!0;else switch(xe){case"string":case"number":Te=!0;break;case"object":switch(B.$$typeof){case e:case n:Te=!0}}if(Te)return Te=B,pe=pe(Te),B=ke===""?"."+D(Te,0):ke,E(pe)?(O="",B!=null&&(O=B.replace(I,"$&/")+"/"),M(pe,ee,O,"",function(Ge){return Ge})):pe!=null&&(F(pe)&&(pe=W(pe,O+(!pe.key||Te&&Te.key===pe.key?"":(""+pe.key).replace(I,"$&/")+"/")+B)),ee.push(pe)),1;if(Te=0,ke=ke===""?".":ke+":",E(B))for(var Ee=0;Ee<B.length;Ee++){xe=B[Ee];var Fe=ke+D(xe,Ee);Te+=M(xe,ee,O,Fe,pe)}else if(Fe=x(B),typeof Fe=="function")for(B=Fe.call(B),Ee=0;!(xe=B.next()).done;)xe=xe.value,Fe=ke+D(xe,Ee++),Te+=M(xe,ee,O,Fe,pe);else if(xe==="object")throw ee=String(B),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.");return Te}function Y(B,ee,O){if(B==null)return B;var ke=[],pe=0;return M(B,ke,"","",function(xe){return ee.call(O,xe,pe++)}),ke}function ae(B){if(B._status===-1){var ee=B._result;ee=ee(),ee.then(function(O){(B._status===0||B._status===-1)&&(B._status=1,B._result=O)},function(O){(B._status===0||B._status===-1)&&(B._status=2,B._result=O)}),B._status===-1&&(B._status=0,B._result=ee)}if(B._status===1)return B._result.default;throw B._result}var H={current:null},Z={transition:null},ue={ReactCurrentDispatcher:H,ReactCurrentBatchConfig:Z,ReactCurrentOwner:$};function q(){throw Error("act(...) is not supported in production builds of React.")}return Be.Children={map:Y,forEach:function(B,ee,O){Y(B,function(){ee.apply(this,arguments)},O)},count:function(B){var ee=0;return Y(B,function(){ee++}),ee},toArray:function(B){return Y(B,function(ee){return ee})||[]},only:function(B){if(!F(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},Be.Component=b,Be.Fragment=s,Be.Profiler=i,Be.PureComponent=S,Be.StrictMode=r,Be.Suspense=u,Be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ue,Be.act=q,Be.cloneElement=function(B,ee,O){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var ke=j({},B.props),pe=B.key,xe=B.ref,Te=B._owner;if(ee!=null){if(ee.ref!==void 0&&(xe=ee.ref,Te=$.current),ee.key!==void 0&&(pe=""+ee.key),B.type&&B.type.defaultProps)var Ee=B.type.defaultProps;for(Fe in ee)z.call(ee,Fe)&&!P.hasOwnProperty(Fe)&&(ke[Fe]=ee[Fe]===void 0&&Ee!==void 0?Ee[Fe]:ee[Fe])}var Fe=arguments.length-2;if(Fe===1)ke.children=O;else if(1<Fe){Ee=Array(Fe);for(var Ge=0;Ge<Fe;Ge++)Ee[Ge]=arguments[Ge+2];ke.children=Ee}return{$$typeof:e,type:B.type,key:pe,ref:xe,props:ke,_owner:Te}},Be.createContext=function(B){return B={$$typeof:l,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:a,_context:B},B.Consumer=B},Be.createElement=L,Be.createFactory=function(B){var ee=L.bind(null,B);return ee.type=B,ee},Be.createRef=function(){return{current:null}},Be.forwardRef=function(B){return{$$typeof:c,render:B}},Be.isValidElement=F,Be.lazy=function(B){return{$$typeof:m,_payload:{_status:-1,_result:B},_init:ae}},Be.memo=function(B,ee){return{$$typeof:h,type:B,compare:ee===void 0?null:ee}},Be.startTransition=function(B){var ee=Z.transition;Z.transition={};try{B()}finally{Z.transition=ee}},Be.unstable_act=q,Be.useCallback=function(B,ee){return H.current.useCallback(B,ee)},Be.useContext=function(B){return H.current.useContext(B)},Be.useDebugValue=function(){},Be.useDeferredValue=function(B){return H.current.useDeferredValue(B)},Be.useEffect=function(B,ee){return H.current.useEffect(B,ee)},Be.useId=function(){return H.current.useId()},Be.useImperativeHandle=function(B,ee,O){return H.current.useImperativeHandle(B,ee,O)},Be.useInsertionEffect=function(B,ee){return H.current.useInsertionEffect(B,ee)},Be.useLayoutEffect=function(B,ee){return H.current.useLayoutEffect(B,ee)},Be.useMemo=function(B,ee){return H.current.useMemo(B,ee)},Be.useReducer=function(B,ee,O){return H.current.useReducer(B,ee,O)},Be.useRef=function(B){return H.current.useRef(B)},Be.useState=function(B){return H.current.useState(B)},Be.useSyncExternalStore=function(B,ee,O){return H.current.useSyncExternalStore(B,ee,O)},Be.useTransition=function(){return H.current.useTransition()},Be.version="18.3.1",Be}var qy;function xl(){return qy||(qy=1,Ap.exports=s8()),Ap.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Iy;function r8(){if(Iy)return No;Iy=1;var e=xl(),n=Symbol.for("react.element"),s=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(c,u,h){var m,p={},x=null,g=null;h!==void 0&&(x=""+h),u.key!==void 0&&(x=""+u.key),u.ref!==void 0&&(g=u.ref);for(m in u)r.call(u,m)&&!a.hasOwnProperty(m)&&(p[m]=u[m]);if(c&&c.defaultProps)for(m in u=c.defaultProps,u)p[m]===void 0&&(p[m]=u[m]);return{$$typeof:n,type:c,key:x,ref:g,props:p,_owner:i.current}}return No.Fragment=s,No.jsx=l,No.jsxs=l,No}var Fy;function i8(){return Fy||(Fy=1,Ep.exports=r8()),Ep.exports}var t=i8(),N=xl();const Uo=Uf(N);var Kc={},Pp={exports:{}},gn={},Rp={exports:{}},qp={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Ly;function a8(){return Ly||(Ly=1,(function(e){function n(Z,ue){var q=Z.length;Z.push(ue);e:for(;0<q;){var B=q-1>>>1,ee=Z[B];if(0<i(ee,ue))Z[B]=ue,Z[q]=ee,q=B;else break e}}function s(Z){return Z.length===0?null:Z[0]}function r(Z){if(Z.length===0)return null;var ue=Z[0],q=Z.pop();if(q!==ue){Z[0]=q;e:for(var B=0,ee=Z.length,O=ee>>>1;B<O;){var ke=2*(B+1)-1,pe=Z[ke],xe=ke+1,Te=Z[xe];if(0>i(pe,q))xe<ee&&0>i(Te,pe)?(Z[B]=Te,Z[xe]=q,B=xe):(Z[B]=pe,Z[ke]=q,B=ke);else if(xe<ee&&0>i(Te,q))Z[B]=Te,Z[xe]=q,B=xe;else break e}}return ue}function i(Z,ue){var q=Z.sortIndex-ue.sortIndex;return q!==0?q:Z.id-ue.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var u=[],h=[],m=1,p=null,x=3,g=!1,j=!1,k=!1,b=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(Z){for(var ue=s(h);ue!==null;){if(ue.callback===null)r(h);else if(ue.startTime<=Z)r(h),ue.sortIndex=ue.expirationTime,n(u,ue);else break;ue=s(h)}}function E(Z){if(k=!1,T(Z),!j)if(s(u)!==null)j=!0,ae(z);else{var ue=s(h);ue!==null&&H(E,ue.startTime-Z)}}function z(Z,ue){j=!1,k&&(k=!1,w(L),L=-1),g=!0;var q=x;try{for(T(ue),p=s(u);p!==null&&(!(p.expirationTime>ue)||Z&&!U());){var B=p.callback;if(typeof B=="function"){p.callback=null,x=p.priorityLevel;var ee=B(p.expirationTime<=ue);ue=e.unstable_now(),typeof ee=="function"?p.callback=ee:p===s(u)&&r(u),T(ue)}else r(u);p=s(u)}if(p!==null)var O=!0;else{var ke=s(h);ke!==null&&H(E,ke.startTime-ue),O=!1}return O}finally{p=null,x=q,g=!1}}var $=!1,P=null,L=-1,W=5,F=-1;function U(){return!(e.unstable_now()-F<W)}function I(){if(P!==null){var Z=e.unstable_now();F=Z;var ue=!0;try{ue=P(!0,Z)}finally{ue?D():($=!1,P=null)}}else $=!1}var D;if(typeof S=="function")D=function(){S(I)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,Y=M.port2;M.port1.onmessage=I,D=function(){Y.postMessage(null)}}else D=function(){b(I,0)};function ae(Z){P=Z,$||($=!0,D())}function H(Z,ue){L=b(function(){Z(e.unstable_now())},ue)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Z){Z.callback=null},e.unstable_continueExecution=function(){j||g||(j=!0,ae(z))},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return s(u)},e.unstable_next=function(Z){switch(x){case 1:case 2:case 3:var ue=3;break;default:ue=x}var q=x;x=ue;try{return Z()}finally{x=q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Z,ue){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var q=x;x=Z;try{return ue()}finally{x=q}},e.unstable_scheduleCallback=function(Z,ue,q){var B=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?B+q:B):q=B,Z){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=q+ee,Z={id:m++,callback:ue,priorityLevel:Z,startTime:q,expirationTime:ee,sortIndex:-1},q>B?(Z.sortIndex=q,n(h,Z),s(u)===null&&Z===s(h)&&(k?(w(L),L=-1):k=!0,H(E,q-B))):(Z.sortIndex=ee,n(u,Z),j||g||(j=!0,ae(z))),Z},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(Z){var ue=x;return function(){var q=x;x=ue;try{return Z.apply(this,arguments)}finally{x=q}}}})(qp)),qp}var zy;function o8(){return zy||(zy=1,Rp.exports=a8()),Rp.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var My;function l8(){if(My)return gn;My=1;var e=xl(),n=o8();function s(o){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+o,f=1;f<arguments.length;f++)d+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+o+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function a(o,d){l(o,d),l(o+"Capture",d)}function l(o,d){for(i[o]=d,o=0;o<d.length;o++)r.add(d[o])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,m={},p={};function x(o){return u.call(p,o)?!0:u.call(m,o)?!1:h.test(o)?p[o]=!0:(m[o]=!0,!1)}function g(o,d,f,y){if(f!==null&&f.type===0)return!1;switch(typeof d){case"function":case"symbol":return!0;case"boolean":return y?!1:f!==null?!f.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function j(o,d,f,y){if(d===null||typeof d>"u"||g(o,d,f,y))return!0;if(y)return!1;if(f!==null)switch(f.type){case 3:return!d;case 4:return d===!1;case 5:return isNaN(d);case 6:return isNaN(d)||1>d}return!1}function k(o,d,f,y,v,C,A){this.acceptsBooleans=d===2||d===3||d===4,this.attributeName=y,this.attributeNamespace=v,this.mustUseProperty=f,this.propertyName=o,this.type=d,this.sanitizeURL=C,this.removeEmptyString=A}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){b[o]=new k(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var d=o[0];b[d]=new k(d,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){b[o]=new k(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){b[o]=new k(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){b[o]=new k(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){b[o]=new k(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){b[o]=new k(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){b[o]=new k(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){b[o]=new k(o,5,!1,o.toLowerCase(),null,!1,!1)});var w=/[\-:]([a-z])/g;function S(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var d=o.replace(w,S);b[d]=new k(d,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var d=o.replace(w,S);b[d]=new k(d,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var d=o.replace(w,S);b[d]=new k(d,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){b[o]=new k(o,1,!1,o.toLowerCase(),null,!1,!1)}),b.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){b[o]=new k(o,1,!1,o.toLowerCase(),null,!0,!0)});function T(o,d,f,y){var v=b.hasOwnProperty(d)?b[d]:null;(v!==null?v.type!==0:y||!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(j(d,f,v,y)&&(f=null),y||v===null?x(d)&&(f===null?o.removeAttribute(d):o.setAttribute(d,""+f)):v.mustUseProperty?o[v.propertyName]=f===null?v.type===3?!1:"":f:(d=v.attributeName,y=v.attributeNamespace,f===null?o.removeAttribute(d):(v=v.type,f=v===3||v===4&&f===!0?"":""+f,y?o.setAttributeNS(y,d,f):o.setAttribute(d,f))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,z=Symbol.for("react.element"),$=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),U=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),H=Symbol.for("react.offscreen"),Z=Symbol.iterator;function ue(o){return o===null||typeof o!="object"?null:(o=Z&&o[Z]||o["@@iterator"],typeof o=="function"?o:null)}var q=Object.assign,B;function ee(o){if(B===void 0)try{throw Error()}catch(f){var d=f.stack.trim().match(/\n( *(at )?)/);B=d&&d[1]||""}return`
34
+ `+B+o}var O=!1;function ke(o,d){if(!o||O)return"";O=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(d)if(d=function(){throw Error()},Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(J){var y=J}Reflect.construct(o,[],d)}else{try{d.call()}catch(J){y=J}o.call(d.prototype)}else{try{throw Error()}catch(J){y=J}o()}}catch(J){if(J&&y&&typeof J.stack=="string"){for(var v=J.stack.split(`
35
+ `),C=y.stack.split(`
36
+ `),A=v.length-1,_=C.length-1;1<=A&&0<=_&&v[A]!==C[_];)_--;for(;1<=A&&0<=_;A--,_--)if(v[A]!==C[_]){if(A!==1||_!==1)do if(A--,_--,0>_||v[A]!==C[_]){var K=`
37
+ `+v[A].replace(" at new "," at ");return o.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",o.displayName)),K}while(1<=A&&0<=_);break}}}finally{O=!1,Error.prepareStackTrace=f}return(o=o?o.displayName||o.name:"")?ee(o):""}function pe(o){switch(o.tag){case 5:return ee(o.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return o=ke(o.type,!1),o;case 11:return o=ke(o.type.render,!1),o;case 1:return o=ke(o.type,!0),o;default:return""}}function xe(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case P:return"Fragment";case $:return"Portal";case W:return"Profiler";case L:return"StrictMode";case D:return"Suspense";case M:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case U:return(o.displayName||"Context")+".Consumer";case F:return(o._context.displayName||"Context")+".Provider";case I:var d=o.render;return o=o.displayName,o||(o=d.displayName||d.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case Y:return d=o.displayName||null,d!==null?d:xe(o.type)||"Memo";case ae:d=o._payload,o=o._init;try{return xe(o(d))}catch{}}return null}function Te(o){var d=o.type;switch(o.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=d.render,o=o.displayName||o.name||"",d.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xe(d);case 8:return d===L?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function Ee(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Fe(o){var d=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function Ge(o){var d=Fe(o)?"checked":"value",f=Object.getOwnPropertyDescriptor(o.constructor.prototype,d),y=""+o[d];if(!o.hasOwnProperty(d)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var v=f.get,C=f.set;return Object.defineProperty(o,d,{configurable:!0,get:function(){return v.call(this)},set:function(A){y=""+A,C.call(this,A)}}),Object.defineProperty(o,d,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(A){y=""+A},stopTracking:function(){o._valueTracker=null,delete o[d]}}}}function pt(o){o._valueTracker||(o._valueTracker=Ge(o))}function sn(o){if(!o)return!1;var d=o._valueTracker;if(!d)return!0;var f=d.getValue(),y="";return o&&(y=Fe(o)?o.checked?"true":"false":o.value),o=y,o!==f?(d.setValue(o),!0):!1}function On(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function dn(o,d){var f=d.checked;return q({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??o._wrapperState.initialChecked})}function js(o,d){var f=d.defaultValue==null?"":d.defaultValue,y=d.checked!=null?d.checked:d.defaultChecked;f=Ee(d.value!=null?d.value:f),o._wrapperState={initialChecked:y,initialValue:f,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function qt(o,d){d=d.checked,d!=null&&T(o,"checked",d,!1)}function _n(o,d){qt(o,d);var f=Ee(d.value),y=d.type;if(f!=null)y==="number"?(f===0&&o.value===""||o.value!=f)&&(o.value=""+f):o.value!==""+f&&(o.value=""+f);else if(y==="submit"||y==="reset"){o.removeAttribute("value");return}d.hasOwnProperty("value")?Nn(o,d.type,f):d.hasOwnProperty("defaultValue")&&Nn(o,d.type,Ee(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(o.defaultChecked=!!d.defaultChecked)}function wn(o,d,f){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var y=d.type;if(!(y!=="submit"&&y!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+o._wrapperState.initialValue,f||d===o.value||(o.value=d),o.defaultValue=d}f=o.name,f!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,f!==""&&(o.name=f)}function Nn(o,d,f){(d!=="number"||On(o.ownerDocument)!==o)&&(f==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+f&&(o.defaultValue=""+f))}var Je=Array.isArray;function Dt(o,d,f,y){if(o=o.options,d){d={};for(var v=0;v<f.length;v++)d["$"+f[v]]=!0;for(f=0;f<o.length;f++)v=d.hasOwnProperty("$"+o[f].value),o[f].selected!==v&&(o[f].selected=v),v&&y&&(o[f].defaultSelected=!0)}else{for(f=""+Ee(f),d=null,v=0;v<o.length;v++){if(o[v].value===f){o[v].selected=!0,y&&(o[v].defaultSelected=!0);return}d!==null||o[v].disabled||(d=o[v])}d!==null&&(d.selected=!0)}}function Sn(o,d){if(d.dangerouslySetInnerHTML!=null)throw Error(s(91));return q({},d,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function ks(o,d){var f=d.value;if(f==null){if(f=d.children,d=d.defaultValue,f!=null){if(d!=null)throw Error(s(92));if(Je(f)){if(1<f.length)throw Error(s(93));f=f[0]}d=f}d==null&&(d=""),f=d}o._wrapperState={initialValue:Ee(f)}}function vs(o,d){var f=Ee(d.value),y=Ee(d.defaultValue);f!=null&&(f=""+f,f!==o.value&&(o.value=f),d.defaultValue==null&&o.defaultValue!==f&&(o.defaultValue=f)),y!=null&&(o.defaultValue=""+y)}function He(o){var d=o.textContent;d===o._wrapperState.initialValue&&d!==""&&d!==null&&(o.value=d)}function te(o){switch(o){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function he(o,d){return o==null||o==="http://www.w3.org/1999/xhtml"?te(d):o==="http://www.w3.org/2000/svg"&&d==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Ae,Oe=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(d,f,y,v){MSApp.execUnsafeLocalFunction(function(){return o(d,f,y,v)})}:o})(function(o,d){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=d;else{for(Ae=Ae||document.createElement("div"),Ae.innerHTML="<svg>"+d.valueOf().toString()+"</svg>",d=Ae.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;d.firstChild;)o.appendChild(d.firstChild)}});function Ke(o,d){if(d){var f=o.firstChild;if(f&&f===o.lastChild&&f.nodeType===3){f.nodeValue=d;return}}o.textContent=d}var Ct={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ns=["Webkit","ms","Moz","O"];Object.keys(Ct).forEach(function(o){ns.forEach(function(d){d=d+o.charAt(0).toUpperCase()+o.substring(1),Ct[d]=Ct[o]})});function rn(o,d,f){return d==null||typeof d=="boolean"||d===""?"":f||typeof d!="number"||d===0||Ct.hasOwnProperty(o)&&Ct[o]?(""+d).trim():d+"px"}function ss(o,d){o=o.style;for(var f in d)if(d.hasOwnProperty(f)){var y=f.indexOf("--")===0,v=rn(f,d[f],y);f==="float"&&(f="cssFloat"),y?o.setProperty(f,v):o[f]=v}}var Os=q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Et(o,d){if(d){if(Os[o]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(s(137,o));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(s(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(s(61))}if(d.style!=null&&typeof d.style!="object")throw Error(s(62))}}function Dn(o,d){if(o.indexOf("-")===-1)return typeof d.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Bt=null;function qi(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Bn=null,rr=null,ne=null;function dt(o){if(o=lo(o)){if(typeof Bn!="function")throw Error(s(280));var d=o.stateNode;d&&(d=oc(d),Bn(o.stateNode,o.type,d))}}function bs(o){rr?ne?ne.push(o):ne=[o]:rr=o}function Cn(){if(rr){var o=rr,d=ne;if(ne=rr=null,dt(o),d)for(o=0;o<d.length;o++)dt(d[o])}}function Wn(o,d){return o(d)}function Jg(){}var Ku=!1;function ex(o,d,f){if(Ku)return o(d,f);Ku=!0;try{return Wn(o,d,f)}finally{Ku=!1,(rr!==null||ne!==null)&&(Jg(),Cn())}}function Da(o,d){var f=o.stateNode;if(f===null)return null;var y=oc(f);if(y===null)return null;f=y[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(o=o.type,y=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!y;break e;default:o=!1}if(o)return null;if(f&&typeof f!="function")throw Error(s(231,d,typeof f));return f}var Vu=!1;if(c)try{var Ba={};Object.defineProperty(Ba,"passive",{get:function(){Vu=!0}}),window.addEventListener("test",Ba,Ba),window.removeEventListener("test",Ba,Ba)}catch{Vu=!1}function c6(o,d,f,y,v,C,A,_,K){var J=Array.prototype.slice.call(arguments,3);try{d.apply(f,J)}catch(le){this.onError(le)}}var Wa=!1,Ol=null,_l=!1,Yu=null,d6={onError:function(o){Wa=!0,Ol=o}};function u6(o,d,f,y,v,C,A,_,K){Wa=!1,Ol=null,c6.apply(d6,arguments)}function h6(o,d,f,y,v,C,A,_,K){if(u6.apply(this,arguments),Wa){if(Wa){var J=Ol;Wa=!1,Ol=null}else throw Error(s(198));_l||(_l=!0,Yu=J)}}function Hr(o){var d=o,f=o;if(o.alternate)for(;d.return;)d=d.return;else{o=d;do d=o,(d.flags&4098)!==0&&(f=d.return),o=d.return;while(o)}return d.tag===3?f:null}function tx(o){if(o.tag===13){var d=o.memoizedState;if(d===null&&(o=o.alternate,o!==null&&(d=o.memoizedState)),d!==null)return d.dehydrated}return null}function nx(o){if(Hr(o)!==o)throw Error(s(188))}function p6(o){var d=o.alternate;if(!d){if(d=Hr(o),d===null)throw Error(s(188));return d!==o?null:o}for(var f=o,y=d;;){var v=f.return;if(v===null)break;var C=v.alternate;if(C===null){if(y=v.return,y!==null){f=y;continue}break}if(v.child===C.child){for(C=v.child;C;){if(C===f)return nx(v),o;if(C===y)return nx(v),d;C=C.sibling}throw Error(s(188))}if(f.return!==y.return)f=v,y=C;else{for(var A=!1,_=v.child;_;){if(_===f){A=!0,f=v,y=C;break}if(_===y){A=!0,y=v,f=C;break}_=_.sibling}if(!A){for(_=C.child;_;){if(_===f){A=!0,f=C,y=v;break}if(_===y){A=!0,y=C,f=v;break}_=_.sibling}if(!A)throw Error(s(189))}}if(f.alternate!==y)throw Error(s(190))}if(f.tag!==3)throw Error(s(188));return f.stateNode.current===f?o:d}function sx(o){return o=p6(o),o!==null?rx(o):null}function rx(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var d=rx(o);if(d!==null)return d;o=o.sibling}return null}var ix=n.unstable_scheduleCallback,ax=n.unstable_cancelCallback,m6=n.unstable_shouldYield,f6=n.unstable_requestPaint,vt=n.unstable_now,g6=n.unstable_getCurrentPriorityLevel,Gu=n.unstable_ImmediatePriority,ox=n.unstable_UserBlockingPriority,Dl=n.unstable_NormalPriority,x6=n.unstable_LowPriority,lx=n.unstable_IdlePriority,Bl=null,ws=null;function y6(o){if(ws&&typeof ws.onCommitFiberRoot=="function")try{ws.onCommitFiberRoot(Bl,o,void 0,(o.current.flags&128)===128)}catch{}}var rs=Math.clz32?Math.clz32:v6,j6=Math.log,k6=Math.LN2;function v6(o){return o>>>=0,o===0?32:31-(j6(o)/k6|0)|0}var Wl=64,Ul=4194304;function Ua(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function Hl(o,d){var f=o.pendingLanes;if(f===0)return 0;var y=0,v=o.suspendedLanes,C=o.pingedLanes,A=f&268435455;if(A!==0){var _=A&~v;_!==0?y=Ua(_):(C&=A,C!==0&&(y=Ua(C)))}else A=f&~v,A!==0?y=Ua(A):C!==0&&(y=Ua(C));if(y===0)return 0;if(d!==0&&d!==y&&(d&v)===0&&(v=y&-y,C=d&-d,v>=C||v===16&&(C&4194240)!==0))return d;if((y&4)!==0&&(y|=f&16),d=o.entangledLanes,d!==0)for(o=o.entanglements,d&=y;0<d;)f=31-rs(d),v=1<<f,y|=o[f],d&=~v;return y}function b6(o,d){switch(o){case 1:case 2:case 4:return d+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function w6(o,d){for(var f=o.suspendedLanes,y=o.pingedLanes,v=o.expirationTimes,C=o.pendingLanes;0<C;){var A=31-rs(C),_=1<<A,K=v[A];K===-1?((_&f)===0||(_&y)!==0)&&(v[A]=b6(_,d)):K<=d&&(o.expiredLanes|=_),C&=~_}}function Qu(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function cx(){var o=Wl;return Wl<<=1,(Wl&4194240)===0&&(Wl=64),o}function Zu(o){for(var d=[],f=0;31>f;f++)d.push(o);return d}function Ha(o,d,f){o.pendingLanes|=d,d!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,d=31-rs(d),o[d]=f}function N6(o,d){var f=o.pendingLanes&~d;o.pendingLanes=d,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=d,o.mutableReadLanes&=d,o.entangledLanes&=d,d=o.entanglements;var y=o.eventTimes;for(o=o.expirationTimes;0<f;){var v=31-rs(f),C=1<<v;d[v]=0,y[v]=-1,o[v]=-1,f&=~C}}function Xu(o,d){var f=o.entangledLanes|=d;for(o=o.entanglements;f;){var y=31-rs(f),v=1<<y;v&d|o[y]&d&&(o[y]|=d),f&=~v}}var nt=0;function dx(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var ux,Ju,hx,px,mx,eh=!1,Kl=[],ir=null,ar=null,or=null,Ka=new Map,Va=new Map,lr=[],S6="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function fx(o,d){switch(o){case"focusin":case"focusout":ir=null;break;case"dragenter":case"dragleave":ar=null;break;case"mouseover":case"mouseout":or=null;break;case"pointerover":case"pointerout":Ka.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":Va.delete(d.pointerId)}}function Ya(o,d,f,y,v,C){return o===null||o.nativeEvent!==C?(o={blockedOn:d,domEventName:f,eventSystemFlags:y,nativeEvent:C,targetContainers:[v]},d!==null&&(d=lo(d),d!==null&&Ju(d)),o):(o.eventSystemFlags|=y,d=o.targetContainers,v!==null&&d.indexOf(v)===-1&&d.push(v),o)}function C6(o,d,f,y,v){switch(d){case"focusin":return ir=Ya(ir,o,d,f,y,v),!0;case"dragenter":return ar=Ya(ar,o,d,f,y,v),!0;case"mouseover":return or=Ya(or,o,d,f,y,v),!0;case"pointerover":var C=v.pointerId;return Ka.set(C,Ya(Ka.get(C)||null,o,d,f,y,v)),!0;case"gotpointercapture":return C=v.pointerId,Va.set(C,Ya(Va.get(C)||null,o,d,f,y,v)),!0}return!1}function gx(o){var d=Kr(o.target);if(d!==null){var f=Hr(d);if(f!==null){if(d=f.tag,d===13){if(d=tx(f),d!==null){o.blockedOn=d,mx(o.priority,function(){hx(f)});return}}else if(d===3&&f.stateNode.current.memoizedState.isDehydrated){o.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Vl(o){if(o.blockedOn!==null)return!1;for(var d=o.targetContainers;0<d.length;){var f=nh(o.domEventName,o.eventSystemFlags,d[0],o.nativeEvent);if(f===null){f=o.nativeEvent;var y=new f.constructor(f.type,f);Bt=y,f.target.dispatchEvent(y),Bt=null}else return d=lo(f),d!==null&&Ju(d),o.blockedOn=f,!1;d.shift()}return!0}function xx(o,d,f){Vl(o)&&f.delete(d)}function $6(){eh=!1,ir!==null&&Vl(ir)&&(ir=null),ar!==null&&Vl(ar)&&(ar=null),or!==null&&Vl(or)&&(or=null),Ka.forEach(xx),Va.forEach(xx)}function Ga(o,d){o.blockedOn===d&&(o.blockedOn=null,eh||(eh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,$6)))}function Qa(o){function d(v){return Ga(v,o)}if(0<Kl.length){Ga(Kl[0],o);for(var f=1;f<Kl.length;f++){var y=Kl[f];y.blockedOn===o&&(y.blockedOn=null)}}for(ir!==null&&Ga(ir,o),ar!==null&&Ga(ar,o),or!==null&&Ga(or,o),Ka.forEach(d),Va.forEach(d),f=0;f<lr.length;f++)y=lr[f],y.blockedOn===o&&(y.blockedOn=null);for(;0<lr.length&&(f=lr[0],f.blockedOn===null);)gx(f),f.blockedOn===null&&lr.shift()}var Ii=E.ReactCurrentBatchConfig,Yl=!0;function T6(o,d,f,y){var v=nt,C=Ii.transition;Ii.transition=null;try{nt=1,th(o,d,f,y)}finally{nt=v,Ii.transition=C}}function E6(o,d,f,y){var v=nt,C=Ii.transition;Ii.transition=null;try{nt=4,th(o,d,f,y)}finally{nt=v,Ii.transition=C}}function th(o,d,f,y){if(Yl){var v=nh(o,d,f,y);if(v===null)jh(o,d,y,Gl,f),fx(o,y);else if(C6(v,o,d,f,y))y.stopPropagation();else if(fx(o,y),d&4&&-1<S6.indexOf(o)){for(;v!==null;){var C=lo(v);if(C!==null&&ux(C),C=nh(o,d,f,y),C===null&&jh(o,d,y,Gl,f),C===v)break;v=C}v!==null&&y.stopPropagation()}else jh(o,d,y,null,f)}}var Gl=null;function nh(o,d,f,y){if(Gl=null,o=qi(y),o=Kr(o),o!==null)if(d=Hr(o),d===null)o=null;else if(f=d.tag,f===13){if(o=tx(d),o!==null)return o;o=null}else if(f===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;o=null}else d!==o&&(o=null);return Gl=o,null}function yx(o){switch(o){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(g6()){case Gu:return 1;case ox:return 4;case Dl:case x6:return 16;case lx:return 536870912;default:return 16}default:return 16}}var cr=null,sh=null,Ql=null;function jx(){if(Ql)return Ql;var o,d=sh,f=d.length,y,v="value"in cr?cr.value:cr.textContent,C=v.length;for(o=0;o<f&&d[o]===v[o];o++);var A=f-o;for(y=1;y<=A&&d[f-y]===v[C-y];y++);return Ql=v.slice(o,1<y?1-y:void 0)}function Zl(o){var d=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&d===13&&(o=13)):o=d,o===10&&(o=13),32<=o||o===13?o:0}function Xl(){return!0}function kx(){return!1}function $n(o){function d(f,y,v,C,A){this._reactName=f,this._targetInst=v,this.type=y,this.nativeEvent=C,this.target=A,this.currentTarget=null;for(var _ in o)o.hasOwnProperty(_)&&(f=o[_],this[_]=f?f(C):C[_]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Xl:kx,this.isPropagationStopped=kx,this}return q(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Xl)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Xl)},persist:function(){},isPersistent:Xl}),d}var Fi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rh=$n(Fi),Za=q({},Fi,{view:0,detail:0}),A6=$n(Za),ih,ah,Xa,Jl=q({},Za,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lh,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Xa&&(Xa&&o.type==="mousemove"?(ih=o.screenX-Xa.screenX,ah=o.screenY-Xa.screenY):ah=ih=0,Xa=o),ih)},movementY:function(o){return"movementY"in o?o.movementY:ah}}),vx=$n(Jl),P6=q({},Jl,{dataTransfer:0}),R6=$n(P6),q6=q({},Za,{relatedTarget:0}),oh=$n(q6),I6=q({},Fi,{animationName:0,elapsedTime:0,pseudoElement:0}),F6=$n(I6),L6=q({},Fi,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),z6=$n(L6),M6=q({},Fi,{data:0}),bx=$n(M6),O6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_6={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},D6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function B6(o){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(o):(o=D6[o])?!!d[o]:!1}function lh(){return B6}var W6=q({},Za,{key:function(o){if(o.key){var d=O6[o.key]||o.key;if(d!=="Unidentified")return d}return o.type==="keypress"?(o=Zl(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?_6[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lh,charCode:function(o){return o.type==="keypress"?Zl(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Zl(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),U6=$n(W6),H6=q({},Jl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wx=$n(H6),K6=q({},Za,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lh}),V6=$n(K6),Y6=q({},Fi,{propertyName:0,elapsedTime:0,pseudoElement:0}),G6=$n(Y6),Q6=q({},Jl,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),Z6=$n(Q6),X6=[9,13,27,32],ch=c&&"CompositionEvent"in window,Ja=null;c&&"documentMode"in document&&(Ja=document.documentMode);var J6=c&&"TextEvent"in window&&!Ja,Nx=c&&(!ch||Ja&&8<Ja&&11>=Ja),Sx=" ",Cx=!1;function $x(o,d){switch(o){case"keyup":return X6.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tx(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Li=!1;function eN(o,d){switch(o){case"compositionend":return Tx(d);case"keypress":return d.which!==32?null:(Cx=!0,Sx);case"textInput":return o=d.data,o===Sx&&Cx?null:o;default:return null}}function tN(o,d){if(Li)return o==="compositionend"||!ch&&$x(o,d)?(o=jx(),Ql=sh=cr=null,Li=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return Nx&&d.locale!=="ko"?null:d.data;default:return null}}var nN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ex(o){var d=o&&o.nodeName&&o.nodeName.toLowerCase();return d==="input"?!!nN[o.type]:d==="textarea"}function Ax(o,d,f,y){bs(y),d=rc(d,"onChange"),0<d.length&&(f=new rh("onChange","change",null,f,y),o.push({event:f,listeners:d}))}var eo=null,to=null;function sN(o){Yx(o,0)}function ec(o){var d=Di(o);if(sn(d))return o}function rN(o,d){if(o==="change")return d}var Px=!1;if(c){var dh;if(c){var uh="oninput"in document;if(!uh){var Rx=document.createElement("div");Rx.setAttribute("oninput","return;"),uh=typeof Rx.oninput=="function"}dh=uh}else dh=!1;Px=dh&&(!document.documentMode||9<document.documentMode)}function qx(){eo&&(eo.detachEvent("onpropertychange",Ix),to=eo=null)}function Ix(o){if(o.propertyName==="value"&&ec(to)){var d=[];Ax(d,to,o,qi(o)),ex(sN,d)}}function iN(o,d,f){o==="focusin"?(qx(),eo=d,to=f,eo.attachEvent("onpropertychange",Ix)):o==="focusout"&&qx()}function aN(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return ec(to)}function oN(o,d){if(o==="click")return ec(d)}function lN(o,d){if(o==="input"||o==="change")return ec(d)}function cN(o,d){return o===d&&(o!==0||1/o===1/d)||o!==o&&d!==d}var is=typeof Object.is=="function"?Object.is:cN;function no(o,d){if(is(o,d))return!0;if(typeof o!="object"||o===null||typeof d!="object"||d===null)return!1;var f=Object.keys(o),y=Object.keys(d);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var v=f[y];if(!u.call(d,v)||!is(o[v],d[v]))return!1}return!0}function Fx(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function Lx(o,d){var f=Fx(o);o=0;for(var y;f;){if(f.nodeType===3){if(y=o+f.textContent.length,o<=d&&y>=d)return{node:f,offset:d-o};o=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Fx(f)}}function zx(o,d){return o&&d?o===d?!0:o&&o.nodeType===3?!1:d&&d.nodeType===3?zx(o,d.parentNode):"contains"in o?o.contains(d):o.compareDocumentPosition?!!(o.compareDocumentPosition(d)&16):!1:!1}function Mx(){for(var o=window,d=On();d instanceof o.HTMLIFrameElement;){try{var f=typeof d.contentWindow.location.href=="string"}catch{f=!1}if(f)o=d.contentWindow;else break;d=On(o.document)}return d}function hh(o){var d=o&&o.nodeName&&o.nodeName.toLowerCase();return d&&(d==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||d==="textarea"||o.contentEditable==="true")}function dN(o){var d=Mx(),f=o.focusedElem,y=o.selectionRange;if(d!==f&&f&&f.ownerDocument&&zx(f.ownerDocument.documentElement,f)){if(y!==null&&hh(f)){if(d=y.start,o=y.end,o===void 0&&(o=d),"selectionStart"in f)f.selectionStart=d,f.selectionEnd=Math.min(o,f.value.length);else if(o=(d=f.ownerDocument||document)&&d.defaultView||window,o.getSelection){o=o.getSelection();var v=f.textContent.length,C=Math.min(y.start,v);y=y.end===void 0?C:Math.min(y.end,v),!o.extend&&C>y&&(v=y,y=C,C=v),v=Lx(f,C);var A=Lx(f,y);v&&A&&(o.rangeCount!==1||o.anchorNode!==v.node||o.anchorOffset!==v.offset||o.focusNode!==A.node||o.focusOffset!==A.offset)&&(d=d.createRange(),d.setStart(v.node,v.offset),o.removeAllRanges(),C>y?(o.addRange(d),o.extend(A.node,A.offset)):(d.setEnd(A.node,A.offset),o.addRange(d)))}}for(d=[],o=f;o=o.parentNode;)o.nodeType===1&&d.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<d.length;f++)o=d[f],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var uN=c&&"documentMode"in document&&11>=document.documentMode,zi=null,ph=null,so=null,mh=!1;function Ox(o,d,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;mh||zi==null||zi!==On(y)||(y=zi,"selectionStart"in y&&hh(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),so&&no(so,y)||(so=y,y=rc(ph,"onSelect"),0<y.length&&(d=new rh("onSelect","select",null,d,f),o.push({event:d,listeners:y}),d.target=zi)))}function tc(o,d){var f={};return f[o.toLowerCase()]=d.toLowerCase(),f["Webkit"+o]="webkit"+d,f["Moz"+o]="moz"+d,f}var Mi={animationend:tc("Animation","AnimationEnd"),animationiteration:tc("Animation","AnimationIteration"),animationstart:tc("Animation","AnimationStart"),transitionend:tc("Transition","TransitionEnd")},fh={},_x={};c&&(_x=document.createElement("div").style,"AnimationEvent"in window||(delete Mi.animationend.animation,delete Mi.animationiteration.animation,delete Mi.animationstart.animation),"TransitionEvent"in window||delete Mi.transitionend.transition);function nc(o){if(fh[o])return fh[o];if(!Mi[o])return o;var d=Mi[o],f;for(f in d)if(d.hasOwnProperty(f)&&f in _x)return fh[o]=d[f];return o}var Dx=nc("animationend"),Bx=nc("animationiteration"),Wx=nc("animationstart"),Ux=nc("transitionend"),Hx=new Map,Kx="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function dr(o,d){Hx.set(o,d),a(d,[o])}for(var gh=0;gh<Kx.length;gh++){var xh=Kx[gh],hN=xh.toLowerCase(),pN=xh[0].toUpperCase()+xh.slice(1);dr(hN,"on"+pN)}dr(Dx,"onAnimationEnd"),dr(Bx,"onAnimationIteration"),dr(Wx,"onAnimationStart"),dr("dblclick","onDoubleClick"),dr("focusin","onFocus"),dr("focusout","onBlur"),dr(Ux,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ro="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),mN=new Set("cancel close invalid load scroll toggle".split(" ").concat(ro));function Vx(o,d,f){var y=o.type||"unknown-event";o.currentTarget=f,h6(y,d,void 0,o),o.currentTarget=null}function Yx(o,d){d=(d&4)!==0;for(var f=0;f<o.length;f++){var y=o[f],v=y.event;y=y.listeners;e:{var C=void 0;if(d)for(var A=y.length-1;0<=A;A--){var _=y[A],K=_.instance,J=_.currentTarget;if(_=_.listener,K!==C&&v.isPropagationStopped())break e;Vx(v,_,J),C=K}else for(A=0;A<y.length;A++){if(_=y[A],K=_.instance,J=_.currentTarget,_=_.listener,K!==C&&v.isPropagationStopped())break e;Vx(v,_,J),C=K}}}if(_l)throw o=Yu,_l=!1,Yu=null,o}function ot(o,d){var f=d[Sh];f===void 0&&(f=d[Sh]=new Set);var y=o+"__bubble";f.has(y)||(Gx(d,o,2,!1),f.add(y))}function yh(o,d,f){var y=0;d&&(y|=4),Gx(f,o,y,d)}var sc="_reactListening"+Math.random().toString(36).slice(2);function io(o){if(!o[sc]){o[sc]=!0,r.forEach(function(f){f!=="selectionchange"&&(mN.has(f)||yh(f,!1,o),yh(f,!0,o))});var d=o.nodeType===9?o:o.ownerDocument;d===null||d[sc]||(d[sc]=!0,yh("selectionchange",!1,d))}}function Gx(o,d,f,y){switch(yx(d)){case 1:var v=T6;break;case 4:v=E6;break;default:v=th}f=v.bind(null,d,f,o),v=void 0,!Vu||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(v=!0),y?v!==void 0?o.addEventListener(d,f,{capture:!0,passive:v}):o.addEventListener(d,f,!0):v!==void 0?o.addEventListener(d,f,{passive:v}):o.addEventListener(d,f,!1)}function jh(o,d,f,y,v){var C=y;if((d&1)===0&&(d&2)===0&&y!==null)e:for(;;){if(y===null)return;var A=y.tag;if(A===3||A===4){var _=y.stateNode.containerInfo;if(_===v||_.nodeType===8&&_.parentNode===v)break;if(A===4)for(A=y.return;A!==null;){var K=A.tag;if((K===3||K===4)&&(K=A.stateNode.containerInfo,K===v||K.nodeType===8&&K.parentNode===v))return;A=A.return}for(;_!==null;){if(A=Kr(_),A===null)return;if(K=A.tag,K===5||K===6){y=C=A;continue e}_=_.parentNode}}y=y.return}ex(function(){var J=C,le=qi(f),de=[];e:{var oe=Hx.get(o);if(oe!==void 0){var be=rh,Ne=o;switch(o){case"keypress":if(Zl(f)===0)break e;case"keydown":case"keyup":be=U6;break;case"focusin":Ne="focus",be=oh;break;case"focusout":Ne="blur",be=oh;break;case"beforeblur":case"afterblur":be=oh;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":be=vx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":be=R6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":be=V6;break;case Dx:case Bx:case Wx:be=F6;break;case Ux:be=G6;break;case"scroll":be=A6;break;case"wheel":be=Z6;break;case"copy":case"cut":case"paste":be=z6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":be=wx}var Se=(d&4)!==0,bt=!Se&&o==="scroll",G=Se?oe!==null?oe+"Capture":null:oe;Se=[];for(var V=J,Q;V!==null;){Q=V;var fe=Q.stateNode;if(Q.tag===5&&fe!==null&&(Q=fe,G!==null&&(fe=Da(V,G),fe!=null&&Se.push(ao(V,fe,Q)))),bt)break;V=V.return}0<Se.length&&(oe=new be(oe,Ne,null,f,le),de.push({event:oe,listeners:Se}))}}if((d&7)===0){e:{if(oe=o==="mouseover"||o==="pointerover",be=o==="mouseout"||o==="pointerout",oe&&f!==Bt&&(Ne=f.relatedTarget||f.fromElement)&&(Kr(Ne)||Ne[_s]))break e;if((be||oe)&&(oe=le.window===le?le:(oe=le.ownerDocument)?oe.defaultView||oe.parentWindow:window,be?(Ne=f.relatedTarget||f.toElement,be=J,Ne=Ne?Kr(Ne):null,Ne!==null&&(bt=Hr(Ne),Ne!==bt||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(be=null,Ne=J),be!==Ne)){if(Se=vx,fe="onMouseLeave",G="onMouseEnter",V="mouse",(o==="pointerout"||o==="pointerover")&&(Se=wx,fe="onPointerLeave",G="onPointerEnter",V="pointer"),bt=be==null?oe:Di(be),Q=Ne==null?oe:Di(Ne),oe=new Se(fe,V+"leave",be,f,le),oe.target=bt,oe.relatedTarget=Q,fe=null,Kr(le)===J&&(Se=new Se(G,V+"enter",Ne,f,le),Se.target=Q,Se.relatedTarget=bt,fe=Se),bt=fe,be&&Ne)t:{for(Se=be,G=Ne,V=0,Q=Se;Q;Q=Oi(Q))V++;for(Q=0,fe=G;fe;fe=Oi(fe))Q++;for(;0<V-Q;)Se=Oi(Se),V--;for(;0<Q-V;)G=Oi(G),Q--;for(;V--;){if(Se===G||G!==null&&Se===G.alternate)break t;Se=Oi(Se),G=Oi(G)}Se=null}else Se=null;be!==null&&Qx(de,oe,be,Se,!1),Ne!==null&&bt!==null&&Qx(de,bt,Ne,Se,!0)}}e:{if(oe=J?Di(J):window,be=oe.nodeName&&oe.nodeName.toLowerCase(),be==="select"||be==="input"&&oe.type==="file")var Ce=rN;else if(Ex(oe))if(Px)Ce=lN;else{Ce=aN;var Pe=iN}else(be=oe.nodeName)&&be.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(Ce=oN);if(Ce&&(Ce=Ce(o,J))){Ax(de,Ce,f,le);break e}Pe&&Pe(o,oe,J),o==="focusout"&&(Pe=oe._wrapperState)&&Pe.controlled&&oe.type==="number"&&Nn(oe,"number",oe.value)}switch(Pe=J?Di(J):window,o){case"focusin":(Ex(Pe)||Pe.contentEditable==="true")&&(zi=Pe,ph=J,so=null);break;case"focusout":so=ph=zi=null;break;case"mousedown":mh=!0;break;case"contextmenu":case"mouseup":case"dragend":mh=!1,Ox(de,f,le);break;case"selectionchange":if(uN)break;case"keydown":case"keyup":Ox(de,f,le)}var Re;if(ch)e:{switch(o){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else Li?$x(o,f)&&(Ie="onCompositionEnd"):o==="keydown"&&f.keyCode===229&&(Ie="onCompositionStart");Ie&&(Nx&&f.locale!=="ko"&&(Li||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&Li&&(Re=jx()):(cr=le,sh="value"in cr?cr.value:cr.textContent,Li=!0)),Pe=rc(J,Ie),0<Pe.length&&(Ie=new bx(Ie,o,null,f,le),de.push({event:Ie,listeners:Pe}),Re?Ie.data=Re:(Re=Tx(f),Re!==null&&(Ie.data=Re)))),(Re=J6?eN(o,f):tN(o,f))&&(J=rc(J,"onBeforeInput"),0<J.length&&(le=new bx("onBeforeInput","beforeinput",null,f,le),de.push({event:le,listeners:J}),le.data=Re))}Yx(de,d)})}function ao(o,d,f){return{instance:o,listener:d,currentTarget:f}}function rc(o,d){for(var f=d+"Capture",y=[];o!==null;){var v=o,C=v.stateNode;v.tag===5&&C!==null&&(v=C,C=Da(o,f),C!=null&&y.unshift(ao(o,C,v)),C=Da(o,d),C!=null&&y.push(ao(o,C,v))),o=o.return}return y}function Oi(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function Qx(o,d,f,y,v){for(var C=d._reactName,A=[];f!==null&&f!==y;){var _=f,K=_.alternate,J=_.stateNode;if(K!==null&&K===y)break;_.tag===5&&J!==null&&(_=J,v?(K=Da(f,C),K!=null&&A.unshift(ao(f,K,_))):v||(K=Da(f,C),K!=null&&A.push(ao(f,K,_)))),f=f.return}A.length!==0&&o.push({event:d,listeners:A})}var fN=/\r\n?/g,gN=/\u0000|\uFFFD/g;function Zx(o){return(typeof o=="string"?o:""+o).replace(fN,`
38
+ `).replace(gN,"")}function ic(o,d,f){if(d=Zx(d),Zx(o)!==d&&f)throw Error(s(425))}function ac(){}var kh=null,vh=null;function bh(o,d){return o==="textarea"||o==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var wh=typeof setTimeout=="function"?setTimeout:void 0,xN=typeof clearTimeout=="function"?clearTimeout:void 0,Xx=typeof Promise=="function"?Promise:void 0,yN=typeof queueMicrotask=="function"?queueMicrotask:typeof Xx<"u"?function(o){return Xx.resolve(null).then(o).catch(jN)}:wh;function jN(o){setTimeout(function(){throw o})}function Nh(o,d){var f=d,y=0;do{var v=f.nextSibling;if(o.removeChild(f),v&&v.nodeType===8)if(f=v.data,f==="/$"){if(y===0){o.removeChild(v),Qa(d);return}y--}else f!=="$"&&f!=="$?"&&f!=="$!"||y++;f=v}while(f);Qa(d)}function ur(o){for(;o!=null;o=o.nextSibling){var d=o.nodeType;if(d===1||d===3)break;if(d===8){if(d=o.data,d==="$"||d==="$!"||d==="$?")break;if(d==="/$")return null}}return o}function Jx(o){o=o.previousSibling;for(var d=0;o;){if(o.nodeType===8){var f=o.data;if(f==="$"||f==="$!"||f==="$?"){if(d===0)return o;d--}else f==="/$"&&d++}o=o.previousSibling}return null}var _i=Math.random().toString(36).slice(2),Ns="__reactFiber$"+_i,oo="__reactProps$"+_i,_s="__reactContainer$"+_i,Sh="__reactEvents$"+_i,kN="__reactListeners$"+_i,vN="__reactHandles$"+_i;function Kr(o){var d=o[Ns];if(d)return d;for(var f=o.parentNode;f;){if(d=f[_s]||f[Ns]){if(f=d.alternate,d.child!==null||f!==null&&f.child!==null)for(o=Jx(o);o!==null;){if(f=o[Ns])return f;o=Jx(o)}return d}o=f,f=o.parentNode}return null}function lo(o){return o=o[Ns]||o[_s],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function Di(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(s(33))}function oc(o){return o[oo]||null}var Ch=[],Bi=-1;function hr(o){return{current:o}}function lt(o){0>Bi||(o.current=Ch[Bi],Ch[Bi]=null,Bi--)}function it(o,d){Bi++,Ch[Bi]=o.current,o.current=d}var pr={},Ht=hr(pr),un=hr(!1),Vr=pr;function Wi(o,d){var f=o.type.contextTypes;if(!f)return pr;var y=o.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===d)return y.__reactInternalMemoizedMaskedChildContext;var v={},C;for(C in f)v[C]=d[C];return y&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=d,o.__reactInternalMemoizedMaskedChildContext=v),v}function hn(o){return o=o.childContextTypes,o!=null}function lc(){lt(un),lt(Ht)}function e0(o,d,f){if(Ht.current!==pr)throw Error(s(168));it(Ht,d),it(un,f)}function t0(o,d,f){var y=o.stateNode;if(d=d.childContextTypes,typeof y.getChildContext!="function")return f;y=y.getChildContext();for(var v in y)if(!(v in d))throw Error(s(108,Te(o)||"Unknown",v));return q({},f,y)}function cc(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||pr,Vr=Ht.current,it(Ht,o),it(un,un.current),!0}function n0(o,d,f){var y=o.stateNode;if(!y)throw Error(s(169));f?(o=t0(o,d,Vr),y.__reactInternalMemoizedMergedChildContext=o,lt(un),lt(Ht),it(Ht,o)):lt(un),it(un,f)}var Ds=null,dc=!1,$h=!1;function s0(o){Ds===null?Ds=[o]:Ds.push(o)}function bN(o){dc=!0,s0(o)}function mr(){if(!$h&&Ds!==null){$h=!0;var o=0,d=nt;try{var f=Ds;for(nt=1;o<f.length;o++){var y=f[o];do y=y(!0);while(y!==null)}Ds=null,dc=!1}catch(v){throw Ds!==null&&(Ds=Ds.slice(o+1)),ix(Gu,mr),v}finally{nt=d,$h=!1}}return null}var Ui=[],Hi=0,uc=null,hc=0,Un=[],Hn=0,Yr=null,Bs=1,Ws="";function Gr(o,d){Ui[Hi++]=hc,Ui[Hi++]=uc,uc=o,hc=d}function r0(o,d,f){Un[Hn++]=Bs,Un[Hn++]=Ws,Un[Hn++]=Yr,Yr=o;var y=Bs;o=Ws;var v=32-rs(y)-1;y&=~(1<<v),f+=1;var C=32-rs(d)+v;if(30<C){var A=v-v%5;C=(y&(1<<A)-1).toString(32),y>>=A,v-=A,Bs=1<<32-rs(d)+v|f<<v|y,Ws=C+o}else Bs=1<<C|f<<v|y,Ws=o}function Th(o){o.return!==null&&(Gr(o,1),r0(o,1,0))}function Eh(o){for(;o===uc;)uc=Ui[--Hi],Ui[Hi]=null,hc=Ui[--Hi],Ui[Hi]=null;for(;o===Yr;)Yr=Un[--Hn],Un[Hn]=null,Ws=Un[--Hn],Un[Hn]=null,Bs=Un[--Hn],Un[Hn]=null}var Tn=null,En=null,ut=!1,as=null;function i0(o,d){var f=Gn(5,null,null,0);f.elementType="DELETED",f.stateNode=d,f.return=o,d=o.deletions,d===null?(o.deletions=[f],o.flags|=16):d.push(f)}function a0(o,d){switch(o.tag){case 5:var f=o.type;return d=d.nodeType!==1||f.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(o.stateNode=d,Tn=o,En=ur(d.firstChild),!0):!1;case 6:return d=o.pendingProps===""||d.nodeType!==3?null:d,d!==null?(o.stateNode=d,Tn=o,En=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(f=Yr!==null?{id:Bs,overflow:Ws}:null,o.memoizedState={dehydrated:d,treeContext:f,retryLane:1073741824},f=Gn(18,null,null,0),f.stateNode=d,f.return=o,o.child=f,Tn=o,En=null,!0):!1;default:return!1}}function Ah(o){return(o.mode&1)!==0&&(o.flags&128)===0}function Ph(o){if(ut){var d=En;if(d){var f=d;if(!a0(o,d)){if(Ah(o))throw Error(s(418));d=ur(f.nextSibling);var y=Tn;d&&a0(o,d)?i0(y,f):(o.flags=o.flags&-4097|2,ut=!1,Tn=o)}}else{if(Ah(o))throw Error(s(418));o.flags=o.flags&-4097|2,ut=!1,Tn=o}}}function o0(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;Tn=o}function pc(o){if(o!==Tn)return!1;if(!ut)return o0(o),ut=!0,!1;var d;if((d=o.tag!==3)&&!(d=o.tag!==5)&&(d=o.type,d=d!=="head"&&d!=="body"&&!bh(o.type,o.memoizedProps)),d&&(d=En)){if(Ah(o))throw l0(),Error(s(418));for(;d;)i0(o,d),d=ur(d.nextSibling)}if(o0(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(s(317));e:{for(o=o.nextSibling,d=0;o;){if(o.nodeType===8){var f=o.data;if(f==="/$"){if(d===0){En=ur(o.nextSibling);break e}d--}else f!=="$"&&f!=="$!"&&f!=="$?"||d++}o=o.nextSibling}En=null}}else En=Tn?ur(o.stateNode.nextSibling):null;return!0}function l0(){for(var o=En;o;)o=ur(o.nextSibling)}function Ki(){En=Tn=null,ut=!1}function Rh(o){as===null?as=[o]:as.push(o)}var wN=E.ReactCurrentBatchConfig;function co(o,d,f){if(o=f.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(s(309));var y=f.stateNode}if(!y)throw Error(s(147,o));var v=y,C=""+o;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===C?d.ref:(d=function(A){var _=v.refs;A===null?delete _[C]:_[C]=A},d._stringRef=C,d)}if(typeof o!="string")throw Error(s(284));if(!f._owner)throw Error(s(290,o))}return o}function mc(o,d){throw o=Object.prototype.toString.call(d),Error(s(31,o==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":o))}function c0(o){var d=o._init;return d(o._payload)}function d0(o){function d(G,V){if(o){var Q=G.deletions;Q===null?(G.deletions=[V],G.flags|=16):Q.push(V)}}function f(G,V){if(!o)return null;for(;V!==null;)d(G,V),V=V.sibling;return null}function y(G,V){for(G=new Map;V!==null;)V.key!==null?G.set(V.key,V):G.set(V.index,V),V=V.sibling;return G}function v(G,V){return G=br(G,V),G.index=0,G.sibling=null,G}function C(G,V,Q){return G.index=Q,o?(Q=G.alternate,Q!==null?(Q=Q.index,Q<V?(G.flags|=2,V):Q):(G.flags|=2,V)):(G.flags|=1048576,V)}function A(G){return o&&G.alternate===null&&(G.flags|=2),G}function _(G,V,Q,fe){return V===null||V.tag!==6?(V=wp(Q,G.mode,fe),V.return=G,V):(V=v(V,Q),V.return=G,V)}function K(G,V,Q,fe){var Ce=Q.type;return Ce===P?le(G,V,Q.props.children,fe,Q.key):V!==null&&(V.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===ae&&c0(Ce)===V.type)?(fe=v(V,Q.props),fe.ref=co(G,V,Q),fe.return=G,fe):(fe=Mc(Q.type,Q.key,Q.props,null,G.mode,fe),fe.ref=co(G,V,Q),fe.return=G,fe)}function J(G,V,Q,fe){return V===null||V.tag!==4||V.stateNode.containerInfo!==Q.containerInfo||V.stateNode.implementation!==Q.implementation?(V=Np(Q,G.mode,fe),V.return=G,V):(V=v(V,Q.children||[]),V.return=G,V)}function le(G,V,Q,fe,Ce){return V===null||V.tag!==7?(V=si(Q,G.mode,fe,Ce),V.return=G,V):(V=v(V,Q),V.return=G,V)}function de(G,V,Q){if(typeof V=="string"&&V!==""||typeof V=="number")return V=wp(""+V,G.mode,Q),V.return=G,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case z:return Q=Mc(V.type,V.key,V.props,null,G.mode,Q),Q.ref=co(G,null,V),Q.return=G,Q;case $:return V=Np(V,G.mode,Q),V.return=G,V;case ae:var fe=V._init;return de(G,fe(V._payload),Q)}if(Je(V)||ue(V))return V=si(V,G.mode,Q,null),V.return=G,V;mc(G,V)}return null}function oe(G,V,Q,fe){var Ce=V!==null?V.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number")return Ce!==null?null:_(G,V,""+Q,fe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case z:return Q.key===Ce?K(G,V,Q,fe):null;case $:return Q.key===Ce?J(G,V,Q,fe):null;case ae:return Ce=Q._init,oe(G,V,Ce(Q._payload),fe)}if(Je(Q)||ue(Q))return Ce!==null?null:le(G,V,Q,fe,null);mc(G,Q)}return null}function be(G,V,Q,fe,Ce){if(typeof fe=="string"&&fe!==""||typeof fe=="number")return G=G.get(Q)||null,_(V,G,""+fe,Ce);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case z:return G=G.get(fe.key===null?Q:fe.key)||null,K(V,G,fe,Ce);case $:return G=G.get(fe.key===null?Q:fe.key)||null,J(V,G,fe,Ce);case ae:var Pe=fe._init;return be(G,V,Q,Pe(fe._payload),Ce)}if(Je(fe)||ue(fe))return G=G.get(Q)||null,le(V,G,fe,Ce,null);mc(V,fe)}return null}function Ne(G,V,Q,fe){for(var Ce=null,Pe=null,Re=V,Ie=V=0,Lt=null;Re!==null&&Ie<Q.length;Ie++){Re.index>Ie?(Lt=Re,Re=null):Lt=Re.sibling;var Ze=oe(G,Re,Q[Ie],fe);if(Ze===null){Re===null&&(Re=Lt);break}o&&Re&&Ze.alternate===null&&d(G,Re),V=C(Ze,V,Ie),Pe===null?Ce=Ze:Pe.sibling=Ze,Pe=Ze,Re=Lt}if(Ie===Q.length)return f(G,Re),ut&&Gr(G,Ie),Ce;if(Re===null){for(;Ie<Q.length;Ie++)Re=de(G,Q[Ie],fe),Re!==null&&(V=C(Re,V,Ie),Pe===null?Ce=Re:Pe.sibling=Re,Pe=Re);return ut&&Gr(G,Ie),Ce}for(Re=y(G,Re);Ie<Q.length;Ie++)Lt=be(Re,G,Ie,Q[Ie],fe),Lt!==null&&(o&&Lt.alternate!==null&&Re.delete(Lt.key===null?Ie:Lt.key),V=C(Lt,V,Ie),Pe===null?Ce=Lt:Pe.sibling=Lt,Pe=Lt);return o&&Re.forEach(function(wr){return d(G,wr)}),ut&&Gr(G,Ie),Ce}function Se(G,V,Q,fe){var Ce=ue(Q);if(typeof Ce!="function")throw Error(s(150));if(Q=Ce.call(Q),Q==null)throw Error(s(151));for(var Pe=Ce=null,Re=V,Ie=V=0,Lt=null,Ze=Q.next();Re!==null&&!Ze.done;Ie++,Ze=Q.next()){Re.index>Ie?(Lt=Re,Re=null):Lt=Re.sibling;var wr=oe(G,Re,Ze.value,fe);if(wr===null){Re===null&&(Re=Lt);break}o&&Re&&wr.alternate===null&&d(G,Re),V=C(wr,V,Ie),Pe===null?Ce=wr:Pe.sibling=wr,Pe=wr,Re=Lt}if(Ze.done)return f(G,Re),ut&&Gr(G,Ie),Ce;if(Re===null){for(;!Ze.done;Ie++,Ze=Q.next())Ze=de(G,Ze.value,fe),Ze!==null&&(V=C(Ze,V,Ie),Pe===null?Ce=Ze:Pe.sibling=Ze,Pe=Ze);return ut&&Gr(G,Ie),Ce}for(Re=y(G,Re);!Ze.done;Ie++,Ze=Q.next())Ze=be(Re,G,Ie,Ze.value,fe),Ze!==null&&(o&&Ze.alternate!==null&&Re.delete(Ze.key===null?Ie:Ze.key),V=C(Ze,V,Ie),Pe===null?Ce=Ze:Pe.sibling=Ze,Pe=Ze);return o&&Re.forEach(function(n8){return d(G,n8)}),ut&&Gr(G,Ie),Ce}function bt(G,V,Q,fe){if(typeof Q=="object"&&Q!==null&&Q.type===P&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case z:e:{for(var Ce=Q.key,Pe=V;Pe!==null;){if(Pe.key===Ce){if(Ce=Q.type,Ce===P){if(Pe.tag===7){f(G,Pe.sibling),V=v(Pe,Q.props.children),V.return=G,G=V;break e}}else if(Pe.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===ae&&c0(Ce)===Pe.type){f(G,Pe.sibling),V=v(Pe,Q.props),V.ref=co(G,Pe,Q),V.return=G,G=V;break e}f(G,Pe);break}else d(G,Pe);Pe=Pe.sibling}Q.type===P?(V=si(Q.props.children,G.mode,fe,Q.key),V.return=G,G=V):(fe=Mc(Q.type,Q.key,Q.props,null,G.mode,fe),fe.ref=co(G,V,Q),fe.return=G,G=fe)}return A(G);case $:e:{for(Pe=Q.key;V!==null;){if(V.key===Pe)if(V.tag===4&&V.stateNode.containerInfo===Q.containerInfo&&V.stateNode.implementation===Q.implementation){f(G,V.sibling),V=v(V,Q.children||[]),V.return=G,G=V;break e}else{f(G,V);break}else d(G,V);V=V.sibling}V=Np(Q,G.mode,fe),V.return=G,G=V}return A(G);case ae:return Pe=Q._init,bt(G,V,Pe(Q._payload),fe)}if(Je(Q))return Ne(G,V,Q,fe);if(ue(Q))return Se(G,V,Q,fe);mc(G,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"?(Q=""+Q,V!==null&&V.tag===6?(f(G,V.sibling),V=v(V,Q),V.return=G,G=V):(f(G,V),V=wp(Q,G.mode,fe),V.return=G,G=V),A(G)):f(G,V)}return bt}var Vi=d0(!0),u0=d0(!1),fc=hr(null),gc=null,Yi=null,qh=null;function Ih(){qh=Yi=gc=null}function Fh(o){var d=fc.current;lt(fc),o._currentValue=d}function Lh(o,d,f){for(;o!==null;){var y=o.alternate;if((o.childLanes&d)!==d?(o.childLanes|=d,y!==null&&(y.childLanes|=d)):y!==null&&(y.childLanes&d)!==d&&(y.childLanes|=d),o===f)break;o=o.return}}function Gi(o,d){gc=o,qh=Yi=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&d)!==0&&(pn=!0),o.firstContext=null)}function Kn(o){var d=o._currentValue;if(qh!==o)if(o={context:o,memoizedValue:d,next:null},Yi===null){if(gc===null)throw Error(s(308));Yi=o,gc.dependencies={lanes:0,firstContext:o}}else Yi=Yi.next=o;return d}var Qr=null;function zh(o){Qr===null?Qr=[o]:Qr.push(o)}function h0(o,d,f,y){var v=d.interleaved;return v===null?(f.next=f,zh(d)):(f.next=v.next,v.next=f),d.interleaved=f,Us(o,y)}function Us(o,d){o.lanes|=d;var f=o.alternate;for(f!==null&&(f.lanes|=d),f=o,o=o.return;o!==null;)o.childLanes|=d,f=o.alternate,f!==null&&(f.childLanes|=d),f=o,o=o.return;return f.tag===3?f.stateNode:null}var fr=!1;function Mh(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function p0(o,d){o=o.updateQueue,d.updateQueue===o&&(d.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function Hs(o,d){return{eventTime:o,lane:d,tag:0,payload:null,callback:null,next:null}}function gr(o,d,f){var y=o.updateQueue;if(y===null)return null;if(y=y.shared,(Qe&2)!==0){var v=y.pending;return v===null?d.next=d:(d.next=v.next,v.next=d),y.pending=d,Us(o,f)}return v=y.interleaved,v===null?(d.next=d,zh(y)):(d.next=v.next,v.next=d),y.interleaved=d,Us(o,f)}function xc(o,d,f){if(d=d.updateQueue,d!==null&&(d=d.shared,(f&4194240)!==0)){var y=d.lanes;y&=o.pendingLanes,f|=y,d.lanes=f,Xu(o,f)}}function m0(o,d){var f=o.updateQueue,y=o.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var v=null,C=null;if(f=f.firstBaseUpdate,f!==null){do{var A={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};C===null?v=C=A:C=C.next=A,f=f.next}while(f!==null);C===null?v=C=d:C=C.next=d}else v=C=d;f={baseState:y.baseState,firstBaseUpdate:v,lastBaseUpdate:C,shared:y.shared,effects:y.effects},o.updateQueue=f;return}o=f.lastBaseUpdate,o===null?f.firstBaseUpdate=d:o.next=d,f.lastBaseUpdate=d}function yc(o,d,f,y){var v=o.updateQueue;fr=!1;var C=v.firstBaseUpdate,A=v.lastBaseUpdate,_=v.shared.pending;if(_!==null){v.shared.pending=null;var K=_,J=K.next;K.next=null,A===null?C=J:A.next=J,A=K;var le=o.alternate;le!==null&&(le=le.updateQueue,_=le.lastBaseUpdate,_!==A&&(_===null?le.firstBaseUpdate=J:_.next=J,le.lastBaseUpdate=K))}if(C!==null){var de=v.baseState;A=0,le=J=K=null,_=C;do{var oe=_.lane,be=_.eventTime;if((y&oe)===oe){le!==null&&(le=le.next={eventTime:be,lane:0,tag:_.tag,payload:_.payload,callback:_.callback,next:null});e:{var Ne=o,Se=_;switch(oe=d,be=f,Se.tag){case 1:if(Ne=Se.payload,typeof Ne=="function"){de=Ne.call(be,de,oe);break e}de=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Se.payload,oe=typeof Ne=="function"?Ne.call(be,de,oe):Ne,oe==null)break e;de=q({},de,oe);break e;case 2:fr=!0}}_.callback!==null&&_.lane!==0&&(o.flags|=64,oe=v.effects,oe===null?v.effects=[_]:oe.push(_))}else be={eventTime:be,lane:oe,tag:_.tag,payload:_.payload,callback:_.callback,next:null},le===null?(J=le=be,K=de):le=le.next=be,A|=oe;if(_=_.next,_===null){if(_=v.shared.pending,_===null)break;oe=_,_=oe.next,oe.next=null,v.lastBaseUpdate=oe,v.shared.pending=null}}while(!0);if(le===null&&(K=de),v.baseState=K,v.firstBaseUpdate=J,v.lastBaseUpdate=le,d=v.shared.interleaved,d!==null){v=d;do A|=v.lane,v=v.next;while(v!==d)}else C===null&&(v.shared.lanes=0);Jr|=A,o.lanes=A,o.memoizedState=de}}function f0(o,d,f){if(o=d.effects,d.effects=null,o!==null)for(d=0;d<o.length;d++){var y=o[d],v=y.callback;if(v!==null){if(y.callback=null,y=f,typeof v!="function")throw Error(s(191,v));v.call(y)}}}var uo={},Ss=hr(uo),ho=hr(uo),po=hr(uo);function Zr(o){if(o===uo)throw Error(s(174));return o}function Oh(o,d){switch(it(po,d),it(ho,o),it(Ss,uo),o=d.nodeType,o){case 9:case 11:d=(d=d.documentElement)?d.namespaceURI:he(null,"");break;default:o=o===8?d.parentNode:d,d=o.namespaceURI||null,o=o.tagName,d=he(d,o)}lt(Ss),it(Ss,d)}function Qi(){lt(Ss),lt(ho),lt(po)}function g0(o){Zr(po.current);var d=Zr(Ss.current),f=he(d,o.type);d!==f&&(it(ho,o),it(Ss,f))}function _h(o){ho.current===o&&(lt(Ss),lt(ho))}var mt=hr(0);function jc(o){for(var d=o;d!==null;){if(d.tag===13){var f=d.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===o)break;for(;d.sibling===null;){if(d.return===null||d.return===o)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var Dh=[];function Bh(){for(var o=0;o<Dh.length;o++)Dh[o]._workInProgressVersionPrimary=null;Dh.length=0}var kc=E.ReactCurrentDispatcher,Wh=E.ReactCurrentBatchConfig,Xr=0,ft=null,At=null,It=null,vc=!1,mo=!1,fo=0,NN=0;function Kt(){throw Error(s(321))}function Uh(o,d){if(d===null)return!1;for(var f=0;f<d.length&&f<o.length;f++)if(!is(o[f],d[f]))return!1;return!0}function Hh(o,d,f,y,v,C){if(Xr=C,ft=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,kc.current=o===null||o.memoizedState===null?TN:EN,o=f(y,v),mo){C=0;do{if(mo=!1,fo=0,25<=C)throw Error(s(301));C+=1,It=At=null,d.updateQueue=null,kc.current=AN,o=f(y,v)}while(mo)}if(kc.current=Nc,d=At!==null&&At.next!==null,Xr=0,It=At=ft=null,vc=!1,d)throw Error(s(300));return o}function Kh(){var o=fo!==0;return fo=0,o}function Cs(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?ft.memoizedState=It=o:It=It.next=o,It}function Vn(){if(At===null){var o=ft.alternate;o=o!==null?o.memoizedState:null}else o=At.next;var d=It===null?ft.memoizedState:It.next;if(d!==null)It=d,At=o;else{if(o===null)throw Error(s(310));At=o,o={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},It===null?ft.memoizedState=It=o:It=It.next=o}return It}function go(o,d){return typeof d=="function"?d(o):d}function Vh(o){var d=Vn(),f=d.queue;if(f===null)throw Error(s(311));f.lastRenderedReducer=o;var y=At,v=y.baseQueue,C=f.pending;if(C!==null){if(v!==null){var A=v.next;v.next=C.next,C.next=A}y.baseQueue=v=C,f.pending=null}if(v!==null){C=v.next,y=y.baseState;var _=A=null,K=null,J=C;do{var le=J.lane;if((Xr&le)===le)K!==null&&(K=K.next={lane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),y=J.hasEagerState?J.eagerState:o(y,J.action);else{var de={lane:le,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null};K===null?(_=K=de,A=y):K=K.next=de,ft.lanes|=le,Jr|=le}J=J.next}while(J!==null&&J!==C);K===null?A=y:K.next=_,is(y,d.memoizedState)||(pn=!0),d.memoizedState=y,d.baseState=A,d.baseQueue=K,f.lastRenderedState=y}if(o=f.interleaved,o!==null){v=o;do C=v.lane,ft.lanes|=C,Jr|=C,v=v.next;while(v!==o)}else v===null&&(f.lanes=0);return[d.memoizedState,f.dispatch]}function Yh(o){var d=Vn(),f=d.queue;if(f===null)throw Error(s(311));f.lastRenderedReducer=o;var y=f.dispatch,v=f.pending,C=d.memoizedState;if(v!==null){f.pending=null;var A=v=v.next;do C=o(C,A.action),A=A.next;while(A!==v);is(C,d.memoizedState)||(pn=!0),d.memoizedState=C,d.baseQueue===null&&(d.baseState=C),f.lastRenderedState=C}return[C,y]}function x0(){}function y0(o,d){var f=ft,y=Vn(),v=d(),C=!is(y.memoizedState,v);if(C&&(y.memoizedState=v,pn=!0),y=y.queue,Gh(v0.bind(null,f,y,o),[o]),y.getSnapshot!==d||C||It!==null&&It.memoizedState.tag&1){if(f.flags|=2048,xo(9,k0.bind(null,f,y,v,d),void 0,null),Ft===null)throw Error(s(349));(Xr&30)!==0||j0(f,d,v)}return v}function j0(o,d,f){o.flags|=16384,o={getSnapshot:d,value:f},d=ft.updateQueue,d===null?(d={lastEffect:null,stores:null},ft.updateQueue=d,d.stores=[o]):(f=d.stores,f===null?d.stores=[o]:f.push(o))}function k0(o,d,f,y){d.value=f,d.getSnapshot=y,b0(d)&&w0(o)}function v0(o,d,f){return f(function(){b0(d)&&w0(o)})}function b0(o){var d=o.getSnapshot;o=o.value;try{var f=d();return!is(o,f)}catch{return!0}}function w0(o){var d=Us(o,1);d!==null&&ds(d,o,1,-1)}function N0(o){var d=Cs();return typeof o=="function"&&(o=o()),d.memoizedState=d.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:o},d.queue=o,o=o.dispatch=$N.bind(null,ft,o),[d.memoizedState,o]}function xo(o,d,f,y){return o={tag:o,create:d,destroy:f,deps:y,next:null},d=ft.updateQueue,d===null?(d={lastEffect:null,stores:null},ft.updateQueue=d,d.lastEffect=o.next=o):(f=d.lastEffect,f===null?d.lastEffect=o.next=o:(y=f.next,f.next=o,o.next=y,d.lastEffect=o)),o}function S0(){return Vn().memoizedState}function bc(o,d,f,y){var v=Cs();ft.flags|=o,v.memoizedState=xo(1|d,f,void 0,y===void 0?null:y)}function wc(o,d,f,y){var v=Vn();y=y===void 0?null:y;var C=void 0;if(At!==null){var A=At.memoizedState;if(C=A.destroy,y!==null&&Uh(y,A.deps)){v.memoizedState=xo(d,f,C,y);return}}ft.flags|=o,v.memoizedState=xo(1|d,f,C,y)}function C0(o,d){return bc(8390656,8,o,d)}function Gh(o,d){return wc(2048,8,o,d)}function $0(o,d){return wc(4,2,o,d)}function T0(o,d){return wc(4,4,o,d)}function E0(o,d){if(typeof d=="function")return o=o(),d(o),function(){d(null)};if(d!=null)return o=o(),d.current=o,function(){d.current=null}}function A0(o,d,f){return f=f!=null?f.concat([o]):null,wc(4,4,E0.bind(null,d,o),f)}function Qh(){}function P0(o,d){var f=Vn();d=d===void 0?null:d;var y=f.memoizedState;return y!==null&&d!==null&&Uh(d,y[1])?y[0]:(f.memoizedState=[o,d],o)}function R0(o,d){var f=Vn();d=d===void 0?null:d;var y=f.memoizedState;return y!==null&&d!==null&&Uh(d,y[1])?y[0]:(o=o(),f.memoizedState=[o,d],o)}function q0(o,d,f){return(Xr&21)===0?(o.baseState&&(o.baseState=!1,pn=!0),o.memoizedState=f):(is(f,d)||(f=cx(),ft.lanes|=f,Jr|=f,o.baseState=!0),d)}function SN(o,d){var f=nt;nt=f!==0&&4>f?f:4,o(!0);var y=Wh.transition;Wh.transition={};try{o(!1),d()}finally{nt=f,Wh.transition=y}}function I0(){return Vn().memoizedState}function CN(o,d,f){var y=kr(o);if(f={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null},F0(o))L0(d,f);else if(f=h0(o,d,f,y),f!==null){var v=on();ds(f,o,y,v),z0(f,d,y)}}function $N(o,d,f){var y=kr(o),v={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null};if(F0(o))L0(d,v);else{var C=o.alternate;if(o.lanes===0&&(C===null||C.lanes===0)&&(C=d.lastRenderedReducer,C!==null))try{var A=d.lastRenderedState,_=C(A,f);if(v.hasEagerState=!0,v.eagerState=_,is(_,A)){var K=d.interleaved;K===null?(v.next=v,zh(d)):(v.next=K.next,K.next=v),d.interleaved=v;return}}catch{}finally{}f=h0(o,d,v,y),f!==null&&(v=on(),ds(f,o,y,v),z0(f,d,y))}}function F0(o){var d=o.alternate;return o===ft||d!==null&&d===ft}function L0(o,d){mo=vc=!0;var f=o.pending;f===null?d.next=d:(d.next=f.next,f.next=d),o.pending=d}function z0(o,d,f){if((f&4194240)!==0){var y=d.lanes;y&=o.pendingLanes,f|=y,d.lanes=f,Xu(o,f)}}var Nc={readContext:Kn,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useInsertionEffect:Kt,useLayoutEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useMutableSource:Kt,useSyncExternalStore:Kt,useId:Kt,unstable_isNewReconciler:!1},TN={readContext:Kn,useCallback:function(o,d){return Cs().memoizedState=[o,d===void 0?null:d],o},useContext:Kn,useEffect:C0,useImperativeHandle:function(o,d,f){return f=f!=null?f.concat([o]):null,bc(4194308,4,E0.bind(null,d,o),f)},useLayoutEffect:function(o,d){return bc(4194308,4,o,d)},useInsertionEffect:function(o,d){return bc(4,2,o,d)},useMemo:function(o,d){var f=Cs();return d=d===void 0?null:d,o=o(),f.memoizedState=[o,d],o},useReducer:function(o,d,f){var y=Cs();return d=f!==void 0?f(d):d,y.memoizedState=y.baseState=d,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:d},y.queue=o,o=o.dispatch=CN.bind(null,ft,o),[y.memoizedState,o]},useRef:function(o){var d=Cs();return o={current:o},d.memoizedState=o},useState:N0,useDebugValue:Qh,useDeferredValue:function(o){return Cs().memoizedState=o},useTransition:function(){var o=N0(!1),d=o[0];return o=SN.bind(null,o[1]),Cs().memoizedState=o,[d,o]},useMutableSource:function(){},useSyncExternalStore:function(o,d,f){var y=ft,v=Cs();if(ut){if(f===void 0)throw Error(s(407));f=f()}else{if(f=d(),Ft===null)throw Error(s(349));(Xr&30)!==0||j0(y,d,f)}v.memoizedState=f;var C={value:f,getSnapshot:d};return v.queue=C,C0(v0.bind(null,y,C,o),[o]),y.flags|=2048,xo(9,k0.bind(null,y,C,f,d),void 0,null),f},useId:function(){var o=Cs(),d=Ft.identifierPrefix;if(ut){var f=Ws,y=Bs;f=(y&~(1<<32-rs(y)-1)).toString(32)+f,d=":"+d+"R"+f,f=fo++,0<f&&(d+="H"+f.toString(32)),d+=":"}else f=NN++,d=":"+d+"r"+f.toString(32)+":";return o.memoizedState=d},unstable_isNewReconciler:!1},EN={readContext:Kn,useCallback:P0,useContext:Kn,useEffect:Gh,useImperativeHandle:A0,useInsertionEffect:$0,useLayoutEffect:T0,useMemo:R0,useReducer:Vh,useRef:S0,useState:function(){return Vh(go)},useDebugValue:Qh,useDeferredValue:function(o){var d=Vn();return q0(d,At.memoizedState,o)},useTransition:function(){var o=Vh(go)[0],d=Vn().memoizedState;return[o,d]},useMutableSource:x0,useSyncExternalStore:y0,useId:I0,unstable_isNewReconciler:!1},AN={readContext:Kn,useCallback:P0,useContext:Kn,useEffect:Gh,useImperativeHandle:A0,useInsertionEffect:$0,useLayoutEffect:T0,useMemo:R0,useReducer:Yh,useRef:S0,useState:function(){return Yh(go)},useDebugValue:Qh,useDeferredValue:function(o){var d=Vn();return At===null?d.memoizedState=o:q0(d,At.memoizedState,o)},useTransition:function(){var o=Yh(go)[0],d=Vn().memoizedState;return[o,d]},useMutableSource:x0,useSyncExternalStore:y0,useId:I0,unstable_isNewReconciler:!1};function os(o,d){if(o&&o.defaultProps){d=q({},d),o=o.defaultProps;for(var f in o)d[f]===void 0&&(d[f]=o[f]);return d}return d}function Zh(o,d,f,y){d=o.memoizedState,f=f(y,d),f=f==null?d:q({},d,f),o.memoizedState=f,o.lanes===0&&(o.updateQueue.baseState=f)}var Sc={isMounted:function(o){return(o=o._reactInternals)?Hr(o)===o:!1},enqueueSetState:function(o,d,f){o=o._reactInternals;var y=on(),v=kr(o),C=Hs(y,v);C.payload=d,f!=null&&(C.callback=f),d=gr(o,C,v),d!==null&&(ds(d,o,v,y),xc(d,o,v))},enqueueReplaceState:function(o,d,f){o=o._reactInternals;var y=on(),v=kr(o),C=Hs(y,v);C.tag=1,C.payload=d,f!=null&&(C.callback=f),d=gr(o,C,v),d!==null&&(ds(d,o,v,y),xc(d,o,v))},enqueueForceUpdate:function(o,d){o=o._reactInternals;var f=on(),y=kr(o),v=Hs(f,y);v.tag=2,d!=null&&(v.callback=d),d=gr(o,v,y),d!==null&&(ds(d,o,y,f),xc(d,o,y))}};function M0(o,d,f,y,v,C,A){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(y,C,A):d.prototype&&d.prototype.isPureReactComponent?!no(f,y)||!no(v,C):!0}function O0(o,d,f){var y=!1,v=pr,C=d.contextType;return typeof C=="object"&&C!==null?C=Kn(C):(v=hn(d)?Vr:Ht.current,y=d.contextTypes,C=(y=y!=null)?Wi(o,v):pr),d=new d(f,C),o.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Sc,o.stateNode=d,d._reactInternals=o,y&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=v,o.__reactInternalMemoizedMaskedChildContext=C),d}function _0(o,d,f,y){o=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(f,y),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(f,y),d.state!==o&&Sc.enqueueReplaceState(d,d.state,null)}function Xh(o,d,f,y){var v=o.stateNode;v.props=f,v.state=o.memoizedState,v.refs={},Mh(o);var C=d.contextType;typeof C=="object"&&C!==null?v.context=Kn(C):(C=hn(d)?Vr:Ht.current,v.context=Wi(o,C)),v.state=o.memoizedState,C=d.getDerivedStateFromProps,typeof C=="function"&&(Zh(o,d,C,f),v.state=o.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(d=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),d!==v.state&&Sc.enqueueReplaceState(v,v.state,null),yc(o,f,v,y),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308)}function Zi(o,d){try{var f="",y=d;do f+=pe(y),y=y.return;while(y);var v=f}catch(C){v=`
39
+ Error generating stack: `+C.message+`
40
+ `+C.stack}return{value:o,source:d,stack:v,digest:null}}function Jh(o,d,f){return{value:o,source:null,stack:f??null,digest:d??null}}function ep(o,d){try{console.error(d.value)}catch(f){setTimeout(function(){throw f})}}var PN=typeof WeakMap=="function"?WeakMap:Map;function D0(o,d,f){f=Hs(-1,f),f.tag=3,f.payload={element:null};var y=d.value;return f.callback=function(){Rc||(Rc=!0,fp=y),ep(o,d)},f}function B0(o,d,f){f=Hs(-1,f),f.tag=3;var y=o.type.getDerivedStateFromError;if(typeof y=="function"){var v=d.value;f.payload=function(){return y(v)},f.callback=function(){ep(o,d)}}var C=o.stateNode;return C!==null&&typeof C.componentDidCatch=="function"&&(f.callback=function(){ep(o,d),typeof y!="function"&&(yr===null?yr=new Set([this]):yr.add(this));var A=d.stack;this.componentDidCatch(d.value,{componentStack:A!==null?A:""})}),f}function W0(o,d,f){var y=o.pingCache;if(y===null){y=o.pingCache=new PN;var v=new Set;y.set(d,v)}else v=y.get(d),v===void 0&&(v=new Set,y.set(d,v));v.has(f)||(v.add(f),o=HN.bind(null,o,d,f),d.then(o,o))}function U0(o){do{var d;if((d=o.tag===13)&&(d=o.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return o;o=o.return}while(o!==null);return null}function H0(o,d,f,y,v){return(o.mode&1)===0?(o===d?o.flags|=65536:(o.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(d=Hs(-1,1),d.tag=2,gr(f,d,1))),f.lanes|=1),o):(o.flags|=65536,o.lanes=v,o)}var RN=E.ReactCurrentOwner,pn=!1;function an(o,d,f,y){d.child=o===null?u0(d,null,f,y):Vi(d,o.child,f,y)}function K0(o,d,f,y,v){f=f.render;var C=d.ref;return Gi(d,v),y=Hh(o,d,f,y,C,v),f=Kh(),o!==null&&!pn?(d.updateQueue=o.updateQueue,d.flags&=-2053,o.lanes&=~v,Ks(o,d,v)):(ut&&f&&Th(d),d.flags|=1,an(o,d,y,v),d.child)}function V0(o,d,f,y,v){if(o===null){var C=f.type;return typeof C=="function"&&!bp(C)&&C.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(d.tag=15,d.type=C,Y0(o,d,C,y,v)):(o=Mc(f.type,null,y,d,d.mode,v),o.ref=d.ref,o.return=d,d.child=o)}if(C=o.child,(o.lanes&v)===0){var A=C.memoizedProps;if(f=f.compare,f=f!==null?f:no,f(A,y)&&o.ref===d.ref)return Ks(o,d,v)}return d.flags|=1,o=br(C,y),o.ref=d.ref,o.return=d,d.child=o}function Y0(o,d,f,y,v){if(o!==null){var C=o.memoizedProps;if(no(C,y)&&o.ref===d.ref)if(pn=!1,d.pendingProps=y=C,(o.lanes&v)!==0)(o.flags&131072)!==0&&(pn=!0);else return d.lanes=o.lanes,Ks(o,d,v)}return tp(o,d,f,y,v)}function G0(o,d,f){var y=d.pendingProps,v=y.children,C=o!==null?o.memoizedState:null;if(y.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null,transitions:null},it(Ji,An),An|=f;else{if((f&1073741824)===0)return o=C!==null?C.baseLanes|f:f,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:o,cachePool:null,transitions:null},d.updateQueue=null,it(Ji,An),An|=o,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=C!==null?C.baseLanes:f,it(Ji,An),An|=y}else C!==null?(y=C.baseLanes|f,d.memoizedState=null):y=f,it(Ji,An),An|=y;return an(o,d,v,f),d.child}function Q0(o,d){var f=d.ref;(o===null&&f!==null||o!==null&&o.ref!==f)&&(d.flags|=512,d.flags|=2097152)}function tp(o,d,f,y,v){var C=hn(f)?Vr:Ht.current;return C=Wi(d,C),Gi(d,v),f=Hh(o,d,f,y,C,v),y=Kh(),o!==null&&!pn?(d.updateQueue=o.updateQueue,d.flags&=-2053,o.lanes&=~v,Ks(o,d,v)):(ut&&y&&Th(d),d.flags|=1,an(o,d,f,v),d.child)}function Z0(o,d,f,y,v){if(hn(f)){var C=!0;cc(d)}else C=!1;if(Gi(d,v),d.stateNode===null)$c(o,d),O0(d,f,y),Xh(d,f,y,v),y=!0;else if(o===null){var A=d.stateNode,_=d.memoizedProps;A.props=_;var K=A.context,J=f.contextType;typeof J=="object"&&J!==null?J=Kn(J):(J=hn(f)?Vr:Ht.current,J=Wi(d,J));var le=f.getDerivedStateFromProps,de=typeof le=="function"||typeof A.getSnapshotBeforeUpdate=="function";de||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(_!==y||K!==J)&&_0(d,A,y,J),fr=!1;var oe=d.memoizedState;A.state=oe,yc(d,y,A,v),K=d.memoizedState,_!==y||oe!==K||un.current||fr?(typeof le=="function"&&(Zh(d,f,le,y),K=d.memoizedState),(_=fr||M0(d,f,_,y,oe,K,J))?(de||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(d.flags|=4194308)):(typeof A.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=y,d.memoizedState=K),A.props=y,A.state=K,A.context=J,y=_):(typeof A.componentDidMount=="function"&&(d.flags|=4194308),y=!1)}else{A=d.stateNode,p0(o,d),_=d.memoizedProps,J=d.type===d.elementType?_:os(d.type,_),A.props=J,de=d.pendingProps,oe=A.context,K=f.contextType,typeof K=="object"&&K!==null?K=Kn(K):(K=hn(f)?Vr:Ht.current,K=Wi(d,K));var be=f.getDerivedStateFromProps;(le=typeof be=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(_!==de||oe!==K)&&_0(d,A,y,K),fr=!1,oe=d.memoizedState,A.state=oe,yc(d,y,A,v);var Ne=d.memoizedState;_!==de||oe!==Ne||un.current||fr?(typeof be=="function"&&(Zh(d,f,be,y),Ne=d.memoizedState),(J=fr||M0(d,f,J,y,oe,Ne,K)||!1)?(le||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(y,Ne,K),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(y,Ne,K)),typeof A.componentDidUpdate=="function"&&(d.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof A.componentDidUpdate!="function"||_===o.memoizedProps&&oe===o.memoizedState||(d.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||_===o.memoizedProps&&oe===o.memoizedState||(d.flags|=1024),d.memoizedProps=y,d.memoizedState=Ne),A.props=y,A.state=Ne,A.context=K,y=J):(typeof A.componentDidUpdate!="function"||_===o.memoizedProps&&oe===o.memoizedState||(d.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||_===o.memoizedProps&&oe===o.memoizedState||(d.flags|=1024),y=!1)}return np(o,d,f,y,C,v)}function np(o,d,f,y,v,C){Q0(o,d);var A=(d.flags&128)!==0;if(!y&&!A)return v&&n0(d,f,!1),Ks(o,d,C);y=d.stateNode,RN.current=d;var _=A&&typeof f.getDerivedStateFromError!="function"?null:y.render();return d.flags|=1,o!==null&&A?(d.child=Vi(d,o.child,null,C),d.child=Vi(d,null,_,C)):an(o,d,_,C),d.memoizedState=y.state,v&&n0(d,f,!0),d.child}function X0(o){var d=o.stateNode;d.pendingContext?e0(o,d.pendingContext,d.pendingContext!==d.context):d.context&&e0(o,d.context,!1),Oh(o,d.containerInfo)}function J0(o,d,f,y,v){return Ki(),Rh(v),d.flags|=256,an(o,d,f,y),d.child}var sp={dehydrated:null,treeContext:null,retryLane:0};function rp(o){return{baseLanes:o,cachePool:null,transitions:null}}function ey(o,d,f){var y=d.pendingProps,v=mt.current,C=!1,A=(d.flags&128)!==0,_;if((_=A)||(_=o!==null&&o.memoizedState===null?!1:(v&2)!==0),_?(C=!0,d.flags&=-129):(o===null||o.memoizedState!==null)&&(v|=1),it(mt,v&1),o===null)return Ph(d),o=d.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((d.mode&1)===0?d.lanes=1:o.data==="$!"?d.lanes=8:d.lanes=1073741824,null):(A=y.children,o=y.fallback,C?(y=d.mode,C=d.child,A={mode:"hidden",children:A},(y&1)===0&&C!==null?(C.childLanes=0,C.pendingProps=A):C=Oc(A,y,0,null),o=si(o,y,f,null),C.return=d,o.return=d,C.sibling=o,d.child=C,d.child.memoizedState=rp(f),d.memoizedState=sp,o):ip(d,A));if(v=o.memoizedState,v!==null&&(_=v.dehydrated,_!==null))return qN(o,d,A,y,_,v,f);if(C){C=y.fallback,A=d.mode,v=o.child,_=v.sibling;var K={mode:"hidden",children:y.children};return(A&1)===0&&d.child!==v?(y=d.child,y.childLanes=0,y.pendingProps=K,d.deletions=null):(y=br(v,K),y.subtreeFlags=v.subtreeFlags&14680064),_!==null?C=br(_,C):(C=si(C,A,f,null),C.flags|=2),C.return=d,y.return=d,y.sibling=C,d.child=y,y=C,C=d.child,A=o.child.memoizedState,A=A===null?rp(f):{baseLanes:A.baseLanes|f,cachePool:null,transitions:A.transitions},C.memoizedState=A,C.childLanes=o.childLanes&~f,d.memoizedState=sp,y}return C=o.child,o=C.sibling,y=br(C,{mode:"visible",children:y.children}),(d.mode&1)===0&&(y.lanes=f),y.return=d,y.sibling=null,o!==null&&(f=d.deletions,f===null?(d.deletions=[o],d.flags|=16):f.push(o)),d.child=y,d.memoizedState=null,y}function ip(o,d){return d=Oc({mode:"visible",children:d},o.mode,0,null),d.return=o,o.child=d}function Cc(o,d,f,y){return y!==null&&Rh(y),Vi(d,o.child,null,f),o=ip(d,d.pendingProps.children),o.flags|=2,d.memoizedState=null,o}function qN(o,d,f,y,v,C,A){if(f)return d.flags&256?(d.flags&=-257,y=Jh(Error(s(422))),Cc(o,d,A,y)):d.memoizedState!==null?(d.child=o.child,d.flags|=128,null):(C=y.fallback,v=d.mode,y=Oc({mode:"visible",children:y.children},v,0,null),C=si(C,v,A,null),C.flags|=2,y.return=d,C.return=d,y.sibling=C,d.child=y,(d.mode&1)!==0&&Vi(d,o.child,null,A),d.child.memoizedState=rp(A),d.memoizedState=sp,C);if((d.mode&1)===0)return Cc(o,d,A,null);if(v.data==="$!"){if(y=v.nextSibling&&v.nextSibling.dataset,y)var _=y.dgst;return y=_,C=Error(s(419)),y=Jh(C,y,void 0),Cc(o,d,A,y)}if(_=(A&o.childLanes)!==0,pn||_){if(y=Ft,y!==null){switch(A&-A){case 4:v=2;break;case 16:v=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:v=32;break;case 536870912:v=268435456;break;default:v=0}v=(v&(y.suspendedLanes|A))!==0?0:v,v!==0&&v!==C.retryLane&&(C.retryLane=v,Us(o,v),ds(y,o,v,-1))}return vp(),y=Jh(Error(s(421))),Cc(o,d,A,y)}return v.data==="$?"?(d.flags|=128,d.child=o.child,d=KN.bind(null,o),v._reactRetry=d,null):(o=C.treeContext,En=ur(v.nextSibling),Tn=d,ut=!0,as=null,o!==null&&(Un[Hn++]=Bs,Un[Hn++]=Ws,Un[Hn++]=Yr,Bs=o.id,Ws=o.overflow,Yr=d),d=ip(d,y.children),d.flags|=4096,d)}function ty(o,d,f){o.lanes|=d;var y=o.alternate;y!==null&&(y.lanes|=d),Lh(o.return,d,f)}function ap(o,d,f,y,v){var C=o.memoizedState;C===null?o.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:v}:(C.isBackwards=d,C.rendering=null,C.renderingStartTime=0,C.last=y,C.tail=f,C.tailMode=v)}function ny(o,d,f){var y=d.pendingProps,v=y.revealOrder,C=y.tail;if(an(o,d,y.children,f),y=mt.current,(y&2)!==0)y=y&1|2,d.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=d.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&ty(o,f,d);else if(o.tag===19)ty(o,f,d);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===d)break e;for(;o.sibling===null;){if(o.return===null||o.return===d)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}y&=1}if(it(mt,y),(d.mode&1)===0)d.memoizedState=null;else switch(v){case"forwards":for(f=d.child,v=null;f!==null;)o=f.alternate,o!==null&&jc(o)===null&&(v=f),f=f.sibling;f=v,f===null?(v=d.child,d.child=null):(v=f.sibling,f.sibling=null),ap(d,!1,v,f,C);break;case"backwards":for(f=null,v=d.child,d.child=null;v!==null;){if(o=v.alternate,o!==null&&jc(o)===null){d.child=v;break}o=v.sibling,v.sibling=f,f=v,v=o}ap(d,!0,f,null,C);break;case"together":ap(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function $c(o,d){(d.mode&1)===0&&o!==null&&(o.alternate=null,d.alternate=null,d.flags|=2)}function Ks(o,d,f){if(o!==null&&(d.dependencies=o.dependencies),Jr|=d.lanes,(f&d.childLanes)===0)return null;if(o!==null&&d.child!==o.child)throw Error(s(153));if(d.child!==null){for(o=d.child,f=br(o,o.pendingProps),d.child=f,f.return=d;o.sibling!==null;)o=o.sibling,f=f.sibling=br(o,o.pendingProps),f.return=d;f.sibling=null}return d.child}function IN(o,d,f){switch(d.tag){case 3:X0(d),Ki();break;case 5:g0(d);break;case 1:hn(d.type)&&cc(d);break;case 4:Oh(d,d.stateNode.containerInfo);break;case 10:var y=d.type._context,v=d.memoizedProps.value;it(fc,y._currentValue),y._currentValue=v;break;case 13:if(y=d.memoizedState,y!==null)return y.dehydrated!==null?(it(mt,mt.current&1),d.flags|=128,null):(f&d.child.childLanes)!==0?ey(o,d,f):(it(mt,mt.current&1),o=Ks(o,d,f),o!==null?o.sibling:null);it(mt,mt.current&1);break;case 19:if(y=(f&d.childLanes)!==0,(o.flags&128)!==0){if(y)return ny(o,d,f);d.flags|=128}if(v=d.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),it(mt,mt.current),y)break;return null;case 22:case 23:return d.lanes=0,G0(o,d,f)}return Ks(o,d,f)}var sy,op,ry,iy;sy=function(o,d){for(var f=d.child;f!==null;){if(f.tag===5||f.tag===6)o.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===d)break;for(;f.sibling===null;){if(f.return===null||f.return===d)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},op=function(){},ry=function(o,d,f,y){var v=o.memoizedProps;if(v!==y){o=d.stateNode,Zr(Ss.current);var C=null;switch(f){case"input":v=dn(o,v),y=dn(o,y),C=[];break;case"select":v=q({},v,{value:void 0}),y=q({},y,{value:void 0}),C=[];break;case"textarea":v=Sn(o,v),y=Sn(o,y),C=[];break;default:typeof v.onClick!="function"&&typeof y.onClick=="function"&&(o.onclick=ac)}Et(f,y);var A;f=null;for(J in v)if(!y.hasOwnProperty(J)&&v.hasOwnProperty(J)&&v[J]!=null)if(J==="style"){var _=v[J];for(A in _)_.hasOwnProperty(A)&&(f||(f={}),f[A]="")}else J!=="dangerouslySetInnerHTML"&&J!=="children"&&J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&J!=="autoFocus"&&(i.hasOwnProperty(J)?C||(C=[]):(C=C||[]).push(J,null));for(J in y){var K=y[J];if(_=v?.[J],y.hasOwnProperty(J)&&K!==_&&(K!=null||_!=null))if(J==="style")if(_){for(A in _)!_.hasOwnProperty(A)||K&&K.hasOwnProperty(A)||(f||(f={}),f[A]="");for(A in K)K.hasOwnProperty(A)&&_[A]!==K[A]&&(f||(f={}),f[A]=K[A])}else f||(C||(C=[]),C.push(J,f)),f=K;else J==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,_=_?_.__html:void 0,K!=null&&_!==K&&(C=C||[]).push(J,K)):J==="children"?typeof K!="string"&&typeof K!="number"||(C=C||[]).push(J,""+K):J!=="suppressContentEditableWarning"&&J!=="suppressHydrationWarning"&&(i.hasOwnProperty(J)?(K!=null&&J==="onScroll"&&ot("scroll",o),C||_===K||(C=[])):(C=C||[]).push(J,K))}f&&(C=C||[]).push("style",f);var J=C;(d.updateQueue=J)&&(d.flags|=4)}},iy=function(o,d,f,y){f!==y&&(d.flags|=4)};function yo(o,d){if(!ut)switch(o.tailMode){case"hidden":d=o.tail;for(var f=null;d!==null;)d.alternate!==null&&(f=d),d=d.sibling;f===null?o.tail=null:f.sibling=null;break;case"collapsed":f=o.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?d||o.tail===null?o.tail=null:o.tail.sibling=null:y.sibling=null}}function Vt(o){var d=o.alternate!==null&&o.alternate.child===o.child,f=0,y=0;if(d)for(var v=o.child;v!==null;)f|=v.lanes|v.childLanes,y|=v.subtreeFlags&14680064,y|=v.flags&14680064,v.return=o,v=v.sibling;else for(v=o.child;v!==null;)f|=v.lanes|v.childLanes,y|=v.subtreeFlags,y|=v.flags,v.return=o,v=v.sibling;return o.subtreeFlags|=y,o.childLanes=f,d}function FN(o,d,f){var y=d.pendingProps;switch(Eh(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(d),null;case 1:return hn(d.type)&&lc(),Vt(d),null;case 3:return y=d.stateNode,Qi(),lt(un),lt(Ht),Bh(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(o===null||o.child===null)&&(pc(d)?d.flags|=4:o===null||o.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,as!==null&&(yp(as),as=null))),op(o,d),Vt(d),null;case 5:_h(d);var v=Zr(po.current);if(f=d.type,o!==null&&d.stateNode!=null)ry(o,d,f,y,v),o.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!y){if(d.stateNode===null)throw Error(s(166));return Vt(d),null}if(o=Zr(Ss.current),pc(d)){y=d.stateNode,f=d.type;var C=d.memoizedProps;switch(y[Ns]=d,y[oo]=C,o=(d.mode&1)!==0,f){case"dialog":ot("cancel",y),ot("close",y);break;case"iframe":case"object":case"embed":ot("load",y);break;case"video":case"audio":for(v=0;v<ro.length;v++)ot(ro[v],y);break;case"source":ot("error",y);break;case"img":case"image":case"link":ot("error",y),ot("load",y);break;case"details":ot("toggle",y);break;case"input":js(y,C),ot("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!C.multiple},ot("invalid",y);break;case"textarea":ks(y,C),ot("invalid",y)}Et(f,C),v=null;for(var A in C)if(C.hasOwnProperty(A)){var _=C[A];A==="children"?typeof _=="string"?y.textContent!==_&&(C.suppressHydrationWarning!==!0&&ic(y.textContent,_,o),v=["children",_]):typeof _=="number"&&y.textContent!==""+_&&(C.suppressHydrationWarning!==!0&&ic(y.textContent,_,o),v=["children",""+_]):i.hasOwnProperty(A)&&_!=null&&A==="onScroll"&&ot("scroll",y)}switch(f){case"input":pt(y),wn(y,C,!0);break;case"textarea":pt(y),He(y);break;case"select":case"option":break;default:typeof C.onClick=="function"&&(y.onclick=ac)}y=v,d.updateQueue=y,y!==null&&(d.flags|=4)}else{A=v.nodeType===9?v:v.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=te(f)),o==="http://www.w3.org/1999/xhtml"?f==="script"?(o=A.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof y.is=="string"?o=A.createElement(f,{is:y.is}):(o=A.createElement(f),f==="select"&&(A=o,y.multiple?A.multiple=!0:y.size&&(A.size=y.size))):o=A.createElementNS(o,f),o[Ns]=d,o[oo]=y,sy(o,d,!1,!1),d.stateNode=o;e:{switch(A=Dn(f,y),f){case"dialog":ot("cancel",o),ot("close",o),v=y;break;case"iframe":case"object":case"embed":ot("load",o),v=y;break;case"video":case"audio":for(v=0;v<ro.length;v++)ot(ro[v],o);v=y;break;case"source":ot("error",o),v=y;break;case"img":case"image":case"link":ot("error",o),ot("load",o),v=y;break;case"details":ot("toggle",o),v=y;break;case"input":js(o,y),v=dn(o,y),ot("invalid",o);break;case"option":v=y;break;case"select":o._wrapperState={wasMultiple:!!y.multiple},v=q({},y,{value:void 0}),ot("invalid",o);break;case"textarea":ks(o,y),v=Sn(o,y),ot("invalid",o);break;default:v=y}Et(f,v),_=v;for(C in _)if(_.hasOwnProperty(C)){var K=_[C];C==="style"?ss(o,K):C==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&Oe(o,K)):C==="children"?typeof K=="string"?(f!=="textarea"||K!=="")&&Ke(o,K):typeof K=="number"&&Ke(o,""+K):C!=="suppressContentEditableWarning"&&C!=="suppressHydrationWarning"&&C!=="autoFocus"&&(i.hasOwnProperty(C)?K!=null&&C==="onScroll"&&ot("scroll",o):K!=null&&T(o,C,K,A))}switch(f){case"input":pt(o),wn(o,y,!1);break;case"textarea":pt(o),He(o);break;case"option":y.value!=null&&o.setAttribute("value",""+Ee(y.value));break;case"select":o.multiple=!!y.multiple,C=y.value,C!=null?Dt(o,!!y.multiple,C,!1):y.defaultValue!=null&&Dt(o,!!y.multiple,y.defaultValue,!0);break;default:typeof v.onClick=="function"&&(o.onclick=ac)}switch(f){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return Vt(d),null;case 6:if(o&&d.stateNode!=null)iy(o,d,o.memoizedProps,y);else{if(typeof y!="string"&&d.stateNode===null)throw Error(s(166));if(f=Zr(po.current),Zr(Ss.current),pc(d)){if(y=d.stateNode,f=d.memoizedProps,y[Ns]=d,(C=y.nodeValue!==f)&&(o=Tn,o!==null))switch(o.tag){case 3:ic(y.nodeValue,f,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&ic(y.nodeValue,f,(o.mode&1)!==0)}C&&(d.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[Ns]=d,d.stateNode=y}return Vt(d),null;case 13:if(lt(mt),y=d.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(ut&&En!==null&&(d.mode&1)!==0&&(d.flags&128)===0)l0(),Ki(),d.flags|=98560,C=!1;else if(C=pc(d),y!==null&&y.dehydrated!==null){if(o===null){if(!C)throw Error(s(318));if(C=d.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(s(317));C[Ns]=d}else Ki(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;Vt(d),C=!1}else as!==null&&(yp(as),as=null),C=!0;if(!C)return d.flags&65536?d:null}return(d.flags&128)!==0?(d.lanes=f,d):(y=y!==null,y!==(o!==null&&o.memoizedState!==null)&&y&&(d.child.flags|=8192,(d.mode&1)!==0&&(o===null||(mt.current&1)!==0?Pt===0&&(Pt=3):vp())),d.updateQueue!==null&&(d.flags|=4),Vt(d),null);case 4:return Qi(),op(o,d),o===null&&io(d.stateNode.containerInfo),Vt(d),null;case 10:return Fh(d.type._context),Vt(d),null;case 17:return hn(d.type)&&lc(),Vt(d),null;case 19:if(lt(mt),C=d.memoizedState,C===null)return Vt(d),null;if(y=(d.flags&128)!==0,A=C.rendering,A===null)if(y)yo(C,!1);else{if(Pt!==0||o!==null&&(o.flags&128)!==0)for(o=d.child;o!==null;){if(A=jc(o),A!==null){for(d.flags|=128,yo(C,!1),y=A.updateQueue,y!==null&&(d.updateQueue=y,d.flags|=4),d.subtreeFlags=0,y=f,f=d.child;f!==null;)C=f,o=y,C.flags&=14680066,A=C.alternate,A===null?(C.childLanes=0,C.lanes=o,C.child=null,C.subtreeFlags=0,C.memoizedProps=null,C.memoizedState=null,C.updateQueue=null,C.dependencies=null,C.stateNode=null):(C.childLanes=A.childLanes,C.lanes=A.lanes,C.child=A.child,C.subtreeFlags=0,C.deletions=null,C.memoizedProps=A.memoizedProps,C.memoizedState=A.memoizedState,C.updateQueue=A.updateQueue,C.type=A.type,o=A.dependencies,C.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),f=f.sibling;return it(mt,mt.current&1|2),d.child}o=o.sibling}C.tail!==null&&vt()>ea&&(d.flags|=128,y=!0,yo(C,!1),d.lanes=4194304)}else{if(!y)if(o=jc(A),o!==null){if(d.flags|=128,y=!0,f=o.updateQueue,f!==null&&(d.updateQueue=f,d.flags|=4),yo(C,!0),C.tail===null&&C.tailMode==="hidden"&&!A.alternate&&!ut)return Vt(d),null}else 2*vt()-C.renderingStartTime>ea&&f!==1073741824&&(d.flags|=128,y=!0,yo(C,!1),d.lanes=4194304);C.isBackwards?(A.sibling=d.child,d.child=A):(f=C.last,f!==null?f.sibling=A:d.child=A,C.last=A)}return C.tail!==null?(d=C.tail,C.rendering=d,C.tail=d.sibling,C.renderingStartTime=vt(),d.sibling=null,f=mt.current,it(mt,y?f&1|2:f&1),d):(Vt(d),null);case 22:case 23:return kp(),y=d.memoizedState!==null,o!==null&&o.memoizedState!==null!==y&&(d.flags|=8192),y&&(d.mode&1)!==0?(An&1073741824)!==0&&(Vt(d),d.subtreeFlags&6&&(d.flags|=8192)):Vt(d),null;case 24:return null;case 25:return null}throw Error(s(156,d.tag))}function LN(o,d){switch(Eh(d),d.tag){case 1:return hn(d.type)&&lc(),o=d.flags,o&65536?(d.flags=o&-65537|128,d):null;case 3:return Qi(),lt(un),lt(Ht),Bh(),o=d.flags,(o&65536)!==0&&(o&128)===0?(d.flags=o&-65537|128,d):null;case 5:return _h(d),null;case 13:if(lt(mt),o=d.memoizedState,o!==null&&o.dehydrated!==null){if(d.alternate===null)throw Error(s(340));Ki()}return o=d.flags,o&65536?(d.flags=o&-65537|128,d):null;case 19:return lt(mt),null;case 4:return Qi(),null;case 10:return Fh(d.type._context),null;case 22:case 23:return kp(),null;case 24:return null;default:return null}}var Tc=!1,Yt=!1,zN=typeof WeakSet=="function"?WeakSet:Set,we=null;function Xi(o,d){var f=o.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){xt(o,d,y)}else f.current=null}function lp(o,d,f){try{f()}catch(y){xt(o,d,y)}}var ay=!1;function MN(o,d){if(kh=Yl,o=Mx(),hh(o)){if("selectionStart"in o)var f={start:o.selectionStart,end:o.selectionEnd};else e:{f=(f=o.ownerDocument)&&f.defaultView||window;var y=f.getSelection&&f.getSelection();if(y&&y.rangeCount!==0){f=y.anchorNode;var v=y.anchorOffset,C=y.focusNode;y=y.focusOffset;try{f.nodeType,C.nodeType}catch{f=null;break e}var A=0,_=-1,K=-1,J=0,le=0,de=o,oe=null;t:for(;;){for(var be;de!==f||v!==0&&de.nodeType!==3||(_=A+v),de!==C||y!==0&&de.nodeType!==3||(K=A+y),de.nodeType===3&&(A+=de.nodeValue.length),(be=de.firstChild)!==null;)oe=de,de=be;for(;;){if(de===o)break t;if(oe===f&&++J===v&&(_=A),oe===C&&++le===y&&(K=A),(be=de.nextSibling)!==null)break;de=oe,oe=de.parentNode}de=be}f=_===-1||K===-1?null:{start:_,end:K}}else f=null}f=f||{start:0,end:0}}else f=null;for(vh={focusedElem:o,selectionRange:f},Yl=!1,we=d;we!==null;)if(d=we,o=d.child,(d.subtreeFlags&1028)!==0&&o!==null)o.return=d,we=o;else for(;we!==null;){d=we;try{var Ne=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var Se=Ne.memoizedProps,bt=Ne.memoizedState,G=d.stateNode,V=G.getSnapshotBeforeUpdate(d.elementType===d.type?Se:os(d.type,Se),bt);G.__reactInternalSnapshotBeforeUpdate=V}break;case 3:var Q=d.stateNode.containerInfo;Q.nodeType===1?Q.textContent="":Q.nodeType===9&&Q.documentElement&&Q.removeChild(Q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(fe){xt(d,d.return,fe)}if(o=d.sibling,o!==null){o.return=d.return,we=o;break}we=d.return}return Ne=ay,ay=!1,Ne}function jo(o,d,f){var y=d.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var v=y=y.next;do{if((v.tag&o)===o){var C=v.destroy;v.destroy=void 0,C!==void 0&&lp(d,f,C)}v=v.next}while(v!==y)}}function Ec(o,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var f=d=d.next;do{if((f.tag&o)===o){var y=f.create;f.destroy=y()}f=f.next}while(f!==d)}}function cp(o){var d=o.ref;if(d!==null){var f=o.stateNode;switch(o.tag){case 5:o=f;break;default:o=f}typeof d=="function"?d(o):d.current=o}}function oy(o){var d=o.alternate;d!==null&&(o.alternate=null,oy(d)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(d=o.stateNode,d!==null&&(delete d[Ns],delete d[oo],delete d[Sh],delete d[kN],delete d[vN])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function ly(o){return o.tag===5||o.tag===3||o.tag===4}function cy(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||ly(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function dp(o,d,f){var y=o.tag;if(y===5||y===6)o=o.stateNode,d?f.nodeType===8?f.parentNode.insertBefore(o,d):f.insertBefore(o,d):(f.nodeType===8?(d=f.parentNode,d.insertBefore(o,f)):(d=f,d.appendChild(o)),f=f._reactRootContainer,f!=null||d.onclick!==null||(d.onclick=ac));else if(y!==4&&(o=o.child,o!==null))for(dp(o,d,f),o=o.sibling;o!==null;)dp(o,d,f),o=o.sibling}function up(o,d,f){var y=o.tag;if(y===5||y===6)o=o.stateNode,d?f.insertBefore(o,d):f.appendChild(o);else if(y!==4&&(o=o.child,o!==null))for(up(o,d,f),o=o.sibling;o!==null;)up(o,d,f),o=o.sibling}var Wt=null,ls=!1;function xr(o,d,f){for(f=f.child;f!==null;)dy(o,d,f),f=f.sibling}function dy(o,d,f){if(ws&&typeof ws.onCommitFiberUnmount=="function")try{ws.onCommitFiberUnmount(Bl,f)}catch{}switch(f.tag){case 5:Yt||Xi(f,d);case 6:var y=Wt,v=ls;Wt=null,xr(o,d,f),Wt=y,ls=v,Wt!==null&&(ls?(o=Wt,f=f.stateNode,o.nodeType===8?o.parentNode.removeChild(f):o.removeChild(f)):Wt.removeChild(f.stateNode));break;case 18:Wt!==null&&(ls?(o=Wt,f=f.stateNode,o.nodeType===8?Nh(o.parentNode,f):o.nodeType===1&&Nh(o,f),Qa(o)):Nh(Wt,f.stateNode));break;case 4:y=Wt,v=ls,Wt=f.stateNode.containerInfo,ls=!0,xr(o,d,f),Wt=y,ls=v;break;case 0:case 11:case 14:case 15:if(!Yt&&(y=f.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){v=y=y.next;do{var C=v,A=C.destroy;C=C.tag,A!==void 0&&((C&2)!==0||(C&4)!==0)&&lp(f,d,A),v=v.next}while(v!==y)}xr(o,d,f);break;case 1:if(!Yt&&(Xi(f,d),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(_){xt(f,d,_)}xr(o,d,f);break;case 21:xr(o,d,f);break;case 22:f.mode&1?(Yt=(y=Yt)||f.memoizedState!==null,xr(o,d,f),Yt=y):xr(o,d,f);break;default:xr(o,d,f)}}function uy(o){var d=o.updateQueue;if(d!==null){o.updateQueue=null;var f=o.stateNode;f===null&&(f=o.stateNode=new zN),d.forEach(function(y){var v=VN.bind(null,o,y);f.has(y)||(f.add(y),y.then(v,v))})}}function cs(o,d){var f=d.deletions;if(f!==null)for(var y=0;y<f.length;y++){var v=f[y];try{var C=o,A=d,_=A;e:for(;_!==null;){switch(_.tag){case 5:Wt=_.stateNode,ls=!1;break e;case 3:Wt=_.stateNode.containerInfo,ls=!0;break e;case 4:Wt=_.stateNode.containerInfo,ls=!0;break e}_=_.return}if(Wt===null)throw Error(s(160));dy(C,A,v),Wt=null,ls=!1;var K=v.alternate;K!==null&&(K.return=null),v.return=null}catch(J){xt(v,d,J)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)hy(d,o),d=d.sibling}function hy(o,d){var f=o.alternate,y=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(cs(d,o),$s(o),y&4){try{jo(3,o,o.return),Ec(3,o)}catch(Se){xt(o,o.return,Se)}try{jo(5,o,o.return)}catch(Se){xt(o,o.return,Se)}}break;case 1:cs(d,o),$s(o),y&512&&f!==null&&Xi(f,f.return);break;case 5:if(cs(d,o),$s(o),y&512&&f!==null&&Xi(f,f.return),o.flags&32){var v=o.stateNode;try{Ke(v,"")}catch(Se){xt(o,o.return,Se)}}if(y&4&&(v=o.stateNode,v!=null)){var C=o.memoizedProps,A=f!==null?f.memoizedProps:C,_=o.type,K=o.updateQueue;if(o.updateQueue=null,K!==null)try{_==="input"&&C.type==="radio"&&C.name!=null&&qt(v,C),Dn(_,A);var J=Dn(_,C);for(A=0;A<K.length;A+=2){var le=K[A],de=K[A+1];le==="style"?ss(v,de):le==="dangerouslySetInnerHTML"?Oe(v,de):le==="children"?Ke(v,de):T(v,le,de,J)}switch(_){case"input":_n(v,C);break;case"textarea":vs(v,C);break;case"select":var oe=v._wrapperState.wasMultiple;v._wrapperState.wasMultiple=!!C.multiple;var be=C.value;be!=null?Dt(v,!!C.multiple,be,!1):oe!==!!C.multiple&&(C.defaultValue!=null?Dt(v,!!C.multiple,C.defaultValue,!0):Dt(v,!!C.multiple,C.multiple?[]:"",!1))}v[oo]=C}catch(Se){xt(o,o.return,Se)}}break;case 6:if(cs(d,o),$s(o),y&4){if(o.stateNode===null)throw Error(s(162));v=o.stateNode,C=o.memoizedProps;try{v.nodeValue=C}catch(Se){xt(o,o.return,Se)}}break;case 3:if(cs(d,o),$s(o),y&4&&f!==null&&f.memoizedState.isDehydrated)try{Qa(d.containerInfo)}catch(Se){xt(o,o.return,Se)}break;case 4:cs(d,o),$s(o);break;case 13:cs(d,o),$s(o),v=o.child,v.flags&8192&&(C=v.memoizedState!==null,v.stateNode.isHidden=C,!C||v.alternate!==null&&v.alternate.memoizedState!==null||(mp=vt())),y&4&&uy(o);break;case 22:if(le=f!==null&&f.memoizedState!==null,o.mode&1?(Yt=(J=Yt)||le,cs(d,o),Yt=J):cs(d,o),$s(o),y&8192){if(J=o.memoizedState!==null,(o.stateNode.isHidden=J)&&!le&&(o.mode&1)!==0)for(we=o,le=o.child;le!==null;){for(de=we=le;we!==null;){switch(oe=we,be=oe.child,oe.tag){case 0:case 11:case 14:case 15:jo(4,oe,oe.return);break;case 1:Xi(oe,oe.return);var Ne=oe.stateNode;if(typeof Ne.componentWillUnmount=="function"){y=oe,f=oe.return;try{d=y,Ne.props=d.memoizedProps,Ne.state=d.memoizedState,Ne.componentWillUnmount()}catch(Se){xt(y,f,Se)}}break;case 5:Xi(oe,oe.return);break;case 22:if(oe.memoizedState!==null){fy(de);continue}}be!==null?(be.return=oe,we=be):fy(de)}le=le.sibling}e:for(le=null,de=o;;){if(de.tag===5){if(le===null){le=de;try{v=de.stateNode,J?(C=v.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none"):(_=de.stateNode,K=de.memoizedProps.style,A=K!=null&&K.hasOwnProperty("display")?K.display:null,_.style.display=rn("display",A))}catch(Se){xt(o,o.return,Se)}}}else if(de.tag===6){if(le===null)try{de.stateNode.nodeValue=J?"":de.memoizedProps}catch(Se){xt(o,o.return,Se)}}else if((de.tag!==22&&de.tag!==23||de.memoizedState===null||de===o)&&de.child!==null){de.child.return=de,de=de.child;continue}if(de===o)break e;for(;de.sibling===null;){if(de.return===null||de.return===o)break e;le===de&&(le=null),de=de.return}le===de&&(le=null),de.sibling.return=de.return,de=de.sibling}}break;case 19:cs(d,o),$s(o),y&4&&uy(o);break;case 21:break;default:cs(d,o),$s(o)}}function $s(o){var d=o.flags;if(d&2){try{e:{for(var f=o.return;f!==null;){if(ly(f)){var y=f;break e}f=f.return}throw Error(s(160))}switch(y.tag){case 5:var v=y.stateNode;y.flags&32&&(Ke(v,""),y.flags&=-33);var C=cy(o);up(o,C,v);break;case 3:case 4:var A=y.stateNode.containerInfo,_=cy(o);dp(o,_,A);break;default:throw Error(s(161))}}catch(K){xt(o,o.return,K)}o.flags&=-3}d&4096&&(o.flags&=-4097)}function ON(o,d,f){we=o,py(o)}function py(o,d,f){for(var y=(o.mode&1)!==0;we!==null;){var v=we,C=v.child;if(v.tag===22&&y){var A=v.memoizedState!==null||Tc;if(!A){var _=v.alternate,K=_!==null&&_.memoizedState!==null||Yt;_=Tc;var J=Yt;if(Tc=A,(Yt=K)&&!J)for(we=v;we!==null;)A=we,K=A.child,A.tag===22&&A.memoizedState!==null?gy(v):K!==null?(K.return=A,we=K):gy(v);for(;C!==null;)we=C,py(C),C=C.sibling;we=v,Tc=_,Yt=J}my(o)}else(v.subtreeFlags&8772)!==0&&C!==null?(C.return=v,we=C):my(o)}}function my(o){for(;we!==null;){var d=we;if((d.flags&8772)!==0){var f=d.alternate;try{if((d.flags&8772)!==0)switch(d.tag){case 0:case 11:case 15:Yt||Ec(5,d);break;case 1:var y=d.stateNode;if(d.flags&4&&!Yt)if(f===null)y.componentDidMount();else{var v=d.elementType===d.type?f.memoizedProps:os(d.type,f.memoizedProps);y.componentDidUpdate(v,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var C=d.updateQueue;C!==null&&f0(d,C,y);break;case 3:var A=d.updateQueue;if(A!==null){if(f=null,d.child!==null)switch(d.child.tag){case 5:f=d.child.stateNode;break;case 1:f=d.child.stateNode}f0(d,A,f)}break;case 5:var _=d.stateNode;if(f===null&&d.flags&4){f=_;var K=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&f.focus();break;case"img":K.src&&(f.src=K.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var J=d.alternate;if(J!==null){var le=J.memoizedState;if(le!==null){var de=le.dehydrated;de!==null&&Qa(de)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}Yt||d.flags&512&&cp(d)}catch(oe){xt(d,d.return,oe)}}if(d===o){we=null;break}if(f=d.sibling,f!==null){f.return=d.return,we=f;break}we=d.return}}function fy(o){for(;we!==null;){var d=we;if(d===o){we=null;break}var f=d.sibling;if(f!==null){f.return=d.return,we=f;break}we=d.return}}function gy(o){for(;we!==null;){var d=we;try{switch(d.tag){case 0:case 11:case 15:var f=d.return;try{Ec(4,d)}catch(K){xt(d,f,K)}break;case 1:var y=d.stateNode;if(typeof y.componentDidMount=="function"){var v=d.return;try{y.componentDidMount()}catch(K){xt(d,v,K)}}var C=d.return;try{cp(d)}catch(K){xt(d,C,K)}break;case 5:var A=d.return;try{cp(d)}catch(K){xt(d,A,K)}}}catch(K){xt(d,d.return,K)}if(d===o){we=null;break}var _=d.sibling;if(_!==null){_.return=d.return,we=_;break}we=d.return}}var _N=Math.ceil,Ac=E.ReactCurrentDispatcher,hp=E.ReactCurrentOwner,Yn=E.ReactCurrentBatchConfig,Qe=0,Ft=null,$t=null,Ut=0,An=0,Ji=hr(0),Pt=0,ko=null,Jr=0,Pc=0,pp=0,vo=null,mn=null,mp=0,ea=1/0,Vs=null,Rc=!1,fp=null,yr=null,qc=!1,jr=null,Ic=0,bo=0,gp=null,Fc=-1,Lc=0;function on(){return(Qe&6)!==0?vt():Fc!==-1?Fc:Fc=vt()}function kr(o){return(o.mode&1)===0?1:(Qe&2)!==0&&Ut!==0?Ut&-Ut:wN.transition!==null?(Lc===0&&(Lc=cx()),Lc):(o=nt,o!==0||(o=window.event,o=o===void 0?16:yx(o.type)),o)}function ds(o,d,f,y){if(50<bo)throw bo=0,gp=null,Error(s(185));Ha(o,f,y),((Qe&2)===0||o!==Ft)&&(o===Ft&&((Qe&2)===0&&(Pc|=f),Pt===4&&vr(o,Ut)),fn(o,y),f===1&&Qe===0&&(d.mode&1)===0&&(ea=vt()+500,dc&&mr()))}function fn(o,d){var f=o.callbackNode;w6(o,d);var y=Hl(o,o===Ft?Ut:0);if(y===0)f!==null&&ax(f),o.callbackNode=null,o.callbackPriority=0;else if(d=y&-y,o.callbackPriority!==d){if(f!=null&&ax(f),d===1)o.tag===0?bN(yy.bind(null,o)):s0(yy.bind(null,o)),yN(function(){(Qe&6)===0&&mr()}),f=null;else{switch(dx(y)){case 1:f=Gu;break;case 4:f=ox;break;case 16:f=Dl;break;case 536870912:f=lx;break;default:f=Dl}f=Cy(f,xy.bind(null,o))}o.callbackPriority=d,o.callbackNode=f}}function xy(o,d){if(Fc=-1,Lc=0,(Qe&6)!==0)throw Error(s(327));var f=o.callbackNode;if(ta()&&o.callbackNode!==f)return null;var y=Hl(o,o===Ft?Ut:0);if(y===0)return null;if((y&30)!==0||(y&o.expiredLanes)!==0||d)d=zc(o,y);else{d=y;var v=Qe;Qe|=2;var C=ky();(Ft!==o||Ut!==d)&&(Vs=null,ea=vt()+500,ti(o,d));do try{WN();break}catch(_){jy(o,_)}while(!0);Ih(),Ac.current=C,Qe=v,$t!==null?d=0:(Ft=null,Ut=0,d=Pt)}if(d!==0){if(d===2&&(v=Qu(o),v!==0&&(y=v,d=xp(o,v))),d===1)throw f=ko,ti(o,0),vr(o,y),fn(o,vt()),f;if(d===6)vr(o,y);else{if(v=o.current.alternate,(y&30)===0&&!DN(v)&&(d=zc(o,y),d===2&&(C=Qu(o),C!==0&&(y=C,d=xp(o,C))),d===1))throw f=ko,ti(o,0),vr(o,y),fn(o,vt()),f;switch(o.finishedWork=v,o.finishedLanes=y,d){case 0:case 1:throw Error(s(345));case 2:ni(o,mn,Vs);break;case 3:if(vr(o,y),(y&130023424)===y&&(d=mp+500-vt(),10<d)){if(Hl(o,0)!==0)break;if(v=o.suspendedLanes,(v&y)!==y){on(),o.pingedLanes|=o.suspendedLanes&v;break}o.timeoutHandle=wh(ni.bind(null,o,mn,Vs),d);break}ni(o,mn,Vs);break;case 4:if(vr(o,y),(y&4194240)===y)break;for(d=o.eventTimes,v=-1;0<y;){var A=31-rs(y);C=1<<A,A=d[A],A>v&&(v=A),y&=~C}if(y=v,y=vt()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*_N(y/1960))-y,10<y){o.timeoutHandle=wh(ni.bind(null,o,mn,Vs),y);break}ni(o,mn,Vs);break;case 5:ni(o,mn,Vs);break;default:throw Error(s(329))}}}return fn(o,vt()),o.callbackNode===f?xy.bind(null,o):null}function xp(o,d){var f=vo;return o.current.memoizedState.isDehydrated&&(ti(o,d).flags|=256),o=zc(o,d),o!==2&&(d=mn,mn=f,d!==null&&yp(d)),o}function yp(o){mn===null?mn=o:mn.push.apply(mn,o)}function DN(o){for(var d=o;;){if(d.flags&16384){var f=d.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var y=0;y<f.length;y++){var v=f[y],C=v.getSnapshot;v=v.value;try{if(!is(C(),v))return!1}catch{return!1}}}if(f=d.child,d.subtreeFlags&16384&&f!==null)f.return=d,d=f;else{if(d===o)break;for(;d.sibling===null;){if(d.return===null||d.return===o)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function vr(o,d){for(d&=~pp,d&=~Pc,o.suspendedLanes|=d,o.pingedLanes&=~d,o=o.expirationTimes;0<d;){var f=31-rs(d),y=1<<f;o[f]=-1,d&=~y}}function yy(o){if((Qe&6)!==0)throw Error(s(327));ta();var d=Hl(o,0);if((d&1)===0)return fn(o,vt()),null;var f=zc(o,d);if(o.tag!==0&&f===2){var y=Qu(o);y!==0&&(d=y,f=xp(o,y))}if(f===1)throw f=ko,ti(o,0),vr(o,d),fn(o,vt()),f;if(f===6)throw Error(s(345));return o.finishedWork=o.current.alternate,o.finishedLanes=d,ni(o,mn,Vs),fn(o,vt()),null}function jp(o,d){var f=Qe;Qe|=1;try{return o(d)}finally{Qe=f,Qe===0&&(ea=vt()+500,dc&&mr())}}function ei(o){jr!==null&&jr.tag===0&&(Qe&6)===0&&ta();var d=Qe;Qe|=1;var f=Yn.transition,y=nt;try{if(Yn.transition=null,nt=1,o)return o()}finally{nt=y,Yn.transition=f,Qe=d,(Qe&6)===0&&mr()}}function kp(){An=Ji.current,lt(Ji)}function ti(o,d){o.finishedWork=null,o.finishedLanes=0;var f=o.timeoutHandle;if(f!==-1&&(o.timeoutHandle=-1,xN(f)),$t!==null)for(f=$t.return;f!==null;){var y=f;switch(Eh(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&lc();break;case 3:Qi(),lt(un),lt(Ht),Bh();break;case 5:_h(y);break;case 4:Qi();break;case 13:lt(mt);break;case 19:lt(mt);break;case 10:Fh(y.type._context);break;case 22:case 23:kp()}f=f.return}if(Ft=o,$t=o=br(o.current,null),Ut=An=d,Pt=0,ko=null,pp=Pc=Jr=0,mn=vo=null,Qr!==null){for(d=0;d<Qr.length;d++)if(f=Qr[d],y=f.interleaved,y!==null){f.interleaved=null;var v=y.next,C=f.pending;if(C!==null){var A=C.next;C.next=v,y.next=A}f.pending=y}Qr=null}return o}function jy(o,d){do{var f=$t;try{if(Ih(),kc.current=Nc,vc){for(var y=ft.memoizedState;y!==null;){var v=y.queue;v!==null&&(v.pending=null),y=y.next}vc=!1}if(Xr=0,It=At=ft=null,mo=!1,fo=0,hp.current=null,f===null||f.return===null){Pt=1,ko=d,$t=null;break}e:{var C=o,A=f.return,_=f,K=d;if(d=Ut,_.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var J=K,le=_,de=le.tag;if((le.mode&1)===0&&(de===0||de===11||de===15)){var oe=le.alternate;oe?(le.updateQueue=oe.updateQueue,le.memoizedState=oe.memoizedState,le.lanes=oe.lanes):(le.updateQueue=null,le.memoizedState=null)}var be=U0(A);if(be!==null){be.flags&=-257,H0(be,A,_,C,d),be.mode&1&&W0(C,J,d),d=be,K=J;var Ne=d.updateQueue;if(Ne===null){var Se=new Set;Se.add(K),d.updateQueue=Se}else Ne.add(K);break e}else{if((d&1)===0){W0(C,J,d),vp();break e}K=Error(s(426))}}else if(ut&&_.mode&1){var bt=U0(A);if(bt!==null){(bt.flags&65536)===0&&(bt.flags|=256),H0(bt,A,_,C,d),Rh(Zi(K,_));break e}}C=K=Zi(K,_),Pt!==4&&(Pt=2),vo===null?vo=[C]:vo.push(C),C=A;do{switch(C.tag){case 3:C.flags|=65536,d&=-d,C.lanes|=d;var G=D0(C,K,d);m0(C,G);break e;case 1:_=K;var V=C.type,Q=C.stateNode;if((C.flags&128)===0&&(typeof V.getDerivedStateFromError=="function"||Q!==null&&typeof Q.componentDidCatch=="function"&&(yr===null||!yr.has(Q)))){C.flags|=65536,d&=-d,C.lanes|=d;var fe=B0(C,_,d);m0(C,fe);break e}}C=C.return}while(C!==null)}by(f)}catch(Ce){d=Ce,$t===f&&f!==null&&($t=f=f.return);continue}break}while(!0)}function ky(){var o=Ac.current;return Ac.current=Nc,o===null?Nc:o}function vp(){(Pt===0||Pt===3||Pt===2)&&(Pt=4),Ft===null||(Jr&268435455)===0&&(Pc&268435455)===0||vr(Ft,Ut)}function zc(o,d){var f=Qe;Qe|=2;var y=ky();(Ft!==o||Ut!==d)&&(Vs=null,ti(o,d));do try{BN();break}catch(v){jy(o,v)}while(!0);if(Ih(),Qe=f,Ac.current=y,$t!==null)throw Error(s(261));return Ft=null,Ut=0,Pt}function BN(){for(;$t!==null;)vy($t)}function WN(){for(;$t!==null&&!m6();)vy($t)}function vy(o){var d=Sy(o.alternate,o,An);o.memoizedProps=o.pendingProps,d===null?by(o):$t=d,hp.current=null}function by(o){var d=o;do{var f=d.alternate;if(o=d.return,(d.flags&32768)===0){if(f=FN(f,d,An),f!==null){$t=f;return}}else{if(f=LN(f,d),f!==null){f.flags&=32767,$t=f;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{Pt=6,$t=null;return}}if(d=d.sibling,d!==null){$t=d;return}$t=d=o}while(d!==null);Pt===0&&(Pt=5)}function ni(o,d,f){var y=nt,v=Yn.transition;try{Yn.transition=null,nt=1,UN(o,d,f,y)}finally{Yn.transition=v,nt=y}return null}function UN(o,d,f,y){do ta();while(jr!==null);if((Qe&6)!==0)throw Error(s(327));f=o.finishedWork;var v=o.finishedLanes;if(f===null)return null;if(o.finishedWork=null,o.finishedLanes=0,f===o.current)throw Error(s(177));o.callbackNode=null,o.callbackPriority=0;var C=f.lanes|f.childLanes;if(N6(o,C),o===Ft&&($t=Ft=null,Ut=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||qc||(qc=!0,Cy(Dl,function(){return ta(),null})),C=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||C){C=Yn.transition,Yn.transition=null;var A=nt;nt=1;var _=Qe;Qe|=4,hp.current=null,MN(o,f),hy(f,o),dN(vh),Yl=!!kh,vh=kh=null,o.current=f,ON(f),f6(),Qe=_,nt=A,Yn.transition=C}else o.current=f;if(qc&&(qc=!1,jr=o,Ic=v),C=o.pendingLanes,C===0&&(yr=null),y6(f.stateNode),fn(o,vt()),d!==null)for(y=o.onRecoverableError,f=0;f<d.length;f++)v=d[f],y(v.value,{componentStack:v.stack,digest:v.digest});if(Rc)throw Rc=!1,o=fp,fp=null,o;return(Ic&1)!==0&&o.tag!==0&&ta(),C=o.pendingLanes,(C&1)!==0?o===gp?bo++:(bo=0,gp=o):bo=0,mr(),null}function ta(){if(jr!==null){var o=dx(Ic),d=Yn.transition,f=nt;try{if(Yn.transition=null,nt=16>o?16:o,jr===null)var y=!1;else{if(o=jr,jr=null,Ic=0,(Qe&6)!==0)throw Error(s(331));var v=Qe;for(Qe|=4,we=o.current;we!==null;){var C=we,A=C.child;if((we.flags&16)!==0){var _=C.deletions;if(_!==null){for(var K=0;K<_.length;K++){var J=_[K];for(we=J;we!==null;){var le=we;switch(le.tag){case 0:case 11:case 15:jo(8,le,C)}var de=le.child;if(de!==null)de.return=le,we=de;else for(;we!==null;){le=we;var oe=le.sibling,be=le.return;if(oy(le),le===J){we=null;break}if(oe!==null){oe.return=be,we=oe;break}we=be}}}var Ne=C.alternate;if(Ne!==null){var Se=Ne.child;if(Se!==null){Ne.child=null;do{var bt=Se.sibling;Se.sibling=null,Se=bt}while(Se!==null)}}we=C}}if((C.subtreeFlags&2064)!==0&&A!==null)A.return=C,we=A;else e:for(;we!==null;){if(C=we,(C.flags&2048)!==0)switch(C.tag){case 0:case 11:case 15:jo(9,C,C.return)}var G=C.sibling;if(G!==null){G.return=C.return,we=G;break e}we=C.return}}var V=o.current;for(we=V;we!==null;){A=we;var Q=A.child;if((A.subtreeFlags&2064)!==0&&Q!==null)Q.return=A,we=Q;else e:for(A=V;we!==null;){if(_=we,(_.flags&2048)!==0)try{switch(_.tag){case 0:case 11:case 15:Ec(9,_)}}catch(Ce){xt(_,_.return,Ce)}if(_===A){we=null;break e}var fe=_.sibling;if(fe!==null){fe.return=_.return,we=fe;break e}we=_.return}}if(Qe=v,mr(),ws&&typeof ws.onPostCommitFiberRoot=="function")try{ws.onPostCommitFiberRoot(Bl,o)}catch{}y=!0}return y}finally{nt=f,Yn.transition=d}}return!1}function wy(o,d,f){d=Zi(f,d),d=D0(o,d,1),o=gr(o,d,1),d=on(),o!==null&&(Ha(o,1,d),fn(o,d))}function xt(o,d,f){if(o.tag===3)wy(o,o,f);else for(;d!==null;){if(d.tag===3){wy(d,o,f);break}else if(d.tag===1){var y=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(yr===null||!yr.has(y))){o=Zi(f,o),o=B0(d,o,1),d=gr(d,o,1),o=on(),d!==null&&(Ha(d,1,o),fn(d,o));break}}d=d.return}}function HN(o,d,f){var y=o.pingCache;y!==null&&y.delete(d),d=on(),o.pingedLanes|=o.suspendedLanes&f,Ft===o&&(Ut&f)===f&&(Pt===4||Pt===3&&(Ut&130023424)===Ut&&500>vt()-mp?ti(o,0):pp|=f),fn(o,d)}function Ny(o,d){d===0&&((o.mode&1)===0?d=1:(d=Ul,Ul<<=1,(Ul&130023424)===0&&(Ul=4194304)));var f=on();o=Us(o,d),o!==null&&(Ha(o,d,f),fn(o,f))}function KN(o){var d=o.memoizedState,f=0;d!==null&&(f=d.retryLane),Ny(o,f)}function VN(o,d){var f=0;switch(o.tag){case 13:var y=o.stateNode,v=o.memoizedState;v!==null&&(f=v.retryLane);break;case 19:y=o.stateNode;break;default:throw Error(s(314))}y!==null&&y.delete(d),Ny(o,f)}var Sy;Sy=function(o,d,f){if(o!==null)if(o.memoizedProps!==d.pendingProps||un.current)pn=!0;else{if((o.lanes&f)===0&&(d.flags&128)===0)return pn=!1,IN(o,d,f);pn=(o.flags&131072)!==0}else pn=!1,ut&&(d.flags&1048576)!==0&&r0(d,hc,d.index);switch(d.lanes=0,d.tag){case 2:var y=d.type;$c(o,d),o=d.pendingProps;var v=Wi(d,Ht.current);Gi(d,f),v=Hh(null,d,y,o,v,f);var C=Kh();return d.flags|=1,typeof v=="object"&&v!==null&&typeof v.render=="function"&&v.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,hn(y)?(C=!0,cc(d)):C=!1,d.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,Mh(d),v.updater=Sc,d.stateNode=v,v._reactInternals=d,Xh(d,y,o,f),d=np(null,d,y,!0,C,f)):(d.tag=0,ut&&C&&Th(d),an(null,d,v,f),d=d.child),d;case 16:y=d.elementType;e:{switch($c(o,d),o=d.pendingProps,v=y._init,y=v(y._payload),d.type=y,v=d.tag=GN(y),o=os(y,o),v){case 0:d=tp(null,d,y,o,f);break e;case 1:d=Z0(null,d,y,o,f);break e;case 11:d=K0(null,d,y,o,f);break e;case 14:d=V0(null,d,y,os(y.type,o),f);break e}throw Error(s(306,y,""))}return d;case 0:return y=d.type,v=d.pendingProps,v=d.elementType===y?v:os(y,v),tp(o,d,y,v,f);case 1:return y=d.type,v=d.pendingProps,v=d.elementType===y?v:os(y,v),Z0(o,d,y,v,f);case 3:e:{if(X0(d),o===null)throw Error(s(387));y=d.pendingProps,C=d.memoizedState,v=C.element,p0(o,d),yc(d,y,null,f);var A=d.memoizedState;if(y=A.element,C.isDehydrated)if(C={element:y,isDehydrated:!1,cache:A.cache,pendingSuspenseBoundaries:A.pendingSuspenseBoundaries,transitions:A.transitions},d.updateQueue.baseState=C,d.memoizedState=C,d.flags&256){v=Zi(Error(s(423)),d),d=J0(o,d,y,f,v);break e}else if(y!==v){v=Zi(Error(s(424)),d),d=J0(o,d,y,f,v);break e}else for(En=ur(d.stateNode.containerInfo.firstChild),Tn=d,ut=!0,as=null,f=u0(d,null,y,f),d.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Ki(),y===v){d=Ks(o,d,f);break e}an(o,d,y,f)}d=d.child}return d;case 5:return g0(d),o===null&&Ph(d),y=d.type,v=d.pendingProps,C=o!==null?o.memoizedProps:null,A=v.children,bh(y,v)?A=null:C!==null&&bh(y,C)&&(d.flags|=32),Q0(o,d),an(o,d,A,f),d.child;case 6:return o===null&&Ph(d),null;case 13:return ey(o,d,f);case 4:return Oh(d,d.stateNode.containerInfo),y=d.pendingProps,o===null?d.child=Vi(d,null,y,f):an(o,d,y,f),d.child;case 11:return y=d.type,v=d.pendingProps,v=d.elementType===y?v:os(y,v),K0(o,d,y,v,f);case 7:return an(o,d,d.pendingProps,f),d.child;case 8:return an(o,d,d.pendingProps.children,f),d.child;case 12:return an(o,d,d.pendingProps.children,f),d.child;case 10:e:{if(y=d.type._context,v=d.pendingProps,C=d.memoizedProps,A=v.value,it(fc,y._currentValue),y._currentValue=A,C!==null)if(is(C.value,A)){if(C.children===v.children&&!un.current){d=Ks(o,d,f);break e}}else for(C=d.child,C!==null&&(C.return=d);C!==null;){var _=C.dependencies;if(_!==null){A=C.child;for(var K=_.firstContext;K!==null;){if(K.context===y){if(C.tag===1){K=Hs(-1,f&-f),K.tag=2;var J=C.updateQueue;if(J!==null){J=J.shared;var le=J.pending;le===null?K.next=K:(K.next=le.next,le.next=K),J.pending=K}}C.lanes|=f,K=C.alternate,K!==null&&(K.lanes|=f),Lh(C.return,f,d),_.lanes|=f;break}K=K.next}}else if(C.tag===10)A=C.type===d.type?null:C.child;else if(C.tag===18){if(A=C.return,A===null)throw Error(s(341));A.lanes|=f,_=A.alternate,_!==null&&(_.lanes|=f),Lh(A,f,d),A=C.sibling}else A=C.child;if(A!==null)A.return=C;else for(A=C;A!==null;){if(A===d){A=null;break}if(C=A.sibling,C!==null){C.return=A.return,A=C;break}A=A.return}C=A}an(o,d,v.children,f),d=d.child}return d;case 9:return v=d.type,y=d.pendingProps.children,Gi(d,f),v=Kn(v),y=y(v),d.flags|=1,an(o,d,y,f),d.child;case 14:return y=d.type,v=os(y,d.pendingProps),v=os(y.type,v),V0(o,d,y,v,f);case 15:return Y0(o,d,d.type,d.pendingProps,f);case 17:return y=d.type,v=d.pendingProps,v=d.elementType===y?v:os(y,v),$c(o,d),d.tag=1,hn(y)?(o=!0,cc(d)):o=!1,Gi(d,f),O0(d,y,v),Xh(d,y,v,f),np(null,d,y,!0,o,f);case 19:return ny(o,d,f);case 22:return G0(o,d,f)}throw Error(s(156,d.tag))};function Cy(o,d){return ix(o,d)}function YN(o,d,f,y){this.tag=o,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gn(o,d,f,y){return new YN(o,d,f,y)}function bp(o){return o=o.prototype,!(!o||!o.isReactComponent)}function GN(o){if(typeof o=="function")return bp(o)?1:0;if(o!=null){if(o=o.$$typeof,o===I)return 11;if(o===Y)return 14}return 2}function br(o,d){var f=o.alternate;return f===null?(f=Gn(o.tag,d,o.key,o.mode),f.elementType=o.elementType,f.type=o.type,f.stateNode=o.stateNode,f.alternate=o,o.alternate=f):(f.pendingProps=d,f.type=o.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=o.flags&14680064,f.childLanes=o.childLanes,f.lanes=o.lanes,f.child=o.child,f.memoizedProps=o.memoizedProps,f.memoizedState=o.memoizedState,f.updateQueue=o.updateQueue,d=o.dependencies,f.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},f.sibling=o.sibling,f.index=o.index,f.ref=o.ref,f}function Mc(o,d,f,y,v,C){var A=2;if(y=o,typeof o=="function")bp(o)&&(A=1);else if(typeof o=="string")A=5;else e:switch(o){case P:return si(f.children,v,C,d);case L:A=8,v|=8;break;case W:return o=Gn(12,f,d,v|2),o.elementType=W,o.lanes=C,o;case D:return o=Gn(13,f,d,v),o.elementType=D,o.lanes=C,o;case M:return o=Gn(19,f,d,v),o.elementType=M,o.lanes=C,o;case H:return Oc(f,v,C,d);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case F:A=10;break e;case U:A=9;break e;case I:A=11;break e;case Y:A=14;break e;case ae:A=16,y=null;break e}throw Error(s(130,o==null?o:typeof o,""))}return d=Gn(A,f,d,v),d.elementType=o,d.type=y,d.lanes=C,d}function si(o,d,f,y){return o=Gn(7,o,y,d),o.lanes=f,o}function Oc(o,d,f,y){return o=Gn(22,o,y,d),o.elementType=H,o.lanes=f,o.stateNode={isHidden:!1},o}function wp(o,d,f){return o=Gn(6,o,null,d),o.lanes=f,o}function Np(o,d,f){return d=Gn(4,o.children!==null?o.children:[],o.key,d),d.lanes=f,d.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},d}function QN(o,d,f,y,v){this.tag=d,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Zu(0),this.expirationTimes=Zu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zu(0),this.identifierPrefix=y,this.onRecoverableError=v,this.mutableSourceEagerHydrationData=null}function Sp(o,d,f,y,v,C,A,_,K){return o=new QN(o,d,f,_,K),d===1?(d=1,C===!0&&(d|=8)):d=0,C=Gn(3,null,null,d),o.current=C,C.stateNode=o,C.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},Mh(C),o}function ZN(o,d,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$,key:y==null?null:""+y,children:o,containerInfo:d,implementation:f}}function $y(o){if(!o)return pr;o=o._reactInternals;e:{if(Hr(o)!==o||o.tag!==1)throw Error(s(170));var d=o;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(hn(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(s(171))}if(o.tag===1){var f=o.type;if(hn(f))return t0(o,f,d)}return d}function Ty(o,d,f,y,v,C,A,_,K){return o=Sp(f,y,!0,o,v,C,A,_,K),o.context=$y(null),f=o.current,y=on(),v=kr(f),C=Hs(y,v),C.callback=d??null,gr(f,C,v),o.current.lanes=v,Ha(o,v,y),fn(o,y),o}function _c(o,d,f,y){var v=d.current,C=on(),A=kr(v);return f=$y(f),d.context===null?d.context=f:d.pendingContext=f,d=Hs(C,A),d.payload={element:o},y=y===void 0?null:y,y!==null&&(d.callback=y),o=gr(v,d,A),o!==null&&(ds(o,v,A,C),xc(o,v,A)),A}function Dc(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function Ey(o,d){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var f=o.retryLane;o.retryLane=f!==0&&f<d?f:d}}function Cp(o,d){Ey(o,d),(o=o.alternate)&&Ey(o,d)}function XN(){return null}var Ay=typeof reportError=="function"?reportError:function(o){console.error(o)};function $p(o){this._internalRoot=o}Bc.prototype.render=$p.prototype.render=function(o){var d=this._internalRoot;if(d===null)throw Error(s(409));_c(o,d,null,null)},Bc.prototype.unmount=$p.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var d=o.containerInfo;ei(function(){_c(null,o,null,null)}),d[_s]=null}};function Bc(o){this._internalRoot=o}Bc.prototype.unstable_scheduleHydration=function(o){if(o){var d=px();o={blockedOn:null,target:o,priority:d};for(var f=0;f<lr.length&&d!==0&&d<lr[f].priority;f++);lr.splice(f,0,o),f===0&&gx(o)}};function Tp(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function Wc(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function Py(){}function JN(o,d,f,y,v){if(v){if(typeof y=="function"){var C=y;y=function(){var J=Dc(A);C.call(J)}}var A=Ty(d,y,o,0,null,!1,!1,"",Py);return o._reactRootContainer=A,o[_s]=A.current,io(o.nodeType===8?o.parentNode:o),ei(),A}for(;v=o.lastChild;)o.removeChild(v);if(typeof y=="function"){var _=y;y=function(){var J=Dc(K);_.call(J)}}var K=Sp(o,0,!1,null,null,!1,!1,"",Py);return o._reactRootContainer=K,o[_s]=K.current,io(o.nodeType===8?o.parentNode:o),ei(function(){_c(d,K,f,y)}),K}function Uc(o,d,f,y,v){var C=f._reactRootContainer;if(C){var A=C;if(typeof v=="function"){var _=v;v=function(){var K=Dc(A);_.call(K)}}_c(d,A,o,v)}else A=JN(f,d,o,v,y);return Dc(A)}ux=function(o){switch(o.tag){case 3:var d=o.stateNode;if(d.current.memoizedState.isDehydrated){var f=Ua(d.pendingLanes);f!==0&&(Xu(d,f|1),fn(d,vt()),(Qe&6)===0&&(ea=vt()+500,mr()))}break;case 13:ei(function(){var y=Us(o,1);if(y!==null){var v=on();ds(y,o,1,v)}}),Cp(o,1)}},Ju=function(o){if(o.tag===13){var d=Us(o,134217728);if(d!==null){var f=on();ds(d,o,134217728,f)}Cp(o,134217728)}},hx=function(o){if(o.tag===13){var d=kr(o),f=Us(o,d);if(f!==null){var y=on();ds(f,o,d,y)}Cp(o,d)}},px=function(){return nt},mx=function(o,d){var f=nt;try{return nt=o,d()}finally{nt=f}},Bn=function(o,d,f){switch(d){case"input":if(_n(o,f),d=f.name,f.type==="radio"&&d!=null){for(f=o;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<f.length;d++){var y=f[d];if(y!==o&&y.form===o.form){var v=oc(y);if(!v)throw Error(s(90));sn(y),_n(y,v)}}}break;case"textarea":vs(o,f);break;case"select":d=f.value,d!=null&&Dt(o,!!f.multiple,d,!1)}},Wn=jp,Jg=ei;var e8={usingClientEntryPoint:!1,Events:[lo,Di,oc,bs,Cn,jp]},wo={findFiberByHostInstance:Kr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},t8={bundleType:wo.bundleType,version:wo.version,rendererPackageName:wo.rendererPackageName,rendererConfig:wo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=sx(o),o===null?null:o.stateNode},findFiberByHostInstance:wo.findFiberByHostInstance||XN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hc.isDisabled&&Hc.supportsFiber)try{Bl=Hc.inject(t8),ws=Hc}catch{}}return gn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e8,gn.createPortal=function(o,d){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Tp(d))throw Error(s(200));return ZN(o,d,null,f)},gn.createRoot=function(o,d){if(!Tp(o))throw Error(s(299));var f=!1,y="",v=Ay;return d!=null&&(d.unstable_strictMode===!0&&(f=!0),d.identifierPrefix!==void 0&&(y=d.identifierPrefix),d.onRecoverableError!==void 0&&(v=d.onRecoverableError)),d=Sp(o,1,!1,null,null,f,!1,y,v),o[_s]=d.current,io(o.nodeType===8?o.parentNode:o),new $p(d)},gn.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var d=o._reactInternals;if(d===void 0)throw typeof o.render=="function"?Error(s(188)):(o=Object.keys(o).join(","),Error(s(268,o)));return o=sx(d),o=o===null?null:o.stateNode,o},gn.flushSync=function(o){return ei(o)},gn.hydrate=function(o,d,f){if(!Wc(d))throw Error(s(200));return Uc(null,o,d,!0,f)},gn.hydrateRoot=function(o,d,f){if(!Tp(o))throw Error(s(405));var y=f!=null&&f.hydratedSources||null,v=!1,C="",A=Ay;if(f!=null&&(f.unstable_strictMode===!0&&(v=!0),f.identifierPrefix!==void 0&&(C=f.identifierPrefix),f.onRecoverableError!==void 0&&(A=f.onRecoverableError)),d=Ty(d,null,o,1,f??null,v,!1,C,A),o[_s]=d.current,io(o),y)for(o=0;o<y.length;o++)f=y[o],v=f._getVersion,v=v(f._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[f,v]:d.mutableSourceEagerHydrationData.push(f,v);return new Bc(d)},gn.render=function(o,d,f){if(!Wc(d))throw Error(s(200));return Uc(null,o,d,!1,f)},gn.unmountComponentAtNode=function(o){if(!Wc(o))throw Error(s(40));return o._reactRootContainer?(ei(function(){Uc(null,null,o,!1,function(){o._reactRootContainer=null,o[_s]=null})}),!0):!1},gn.unstable_batchedUpdates=jp,gn.unstable_renderSubtreeIntoContainer=function(o,d,f,y){if(!Wc(f))throw Error(s(200));if(o==null||o._reactInternals===void 0)throw Error(s(38));return Uc(o,d,f,!1,y)},gn.version="18.3.1-next-f1338f8080-20240426",gn}var Oy;function Gk(){if(Oy)return Pp.exports;Oy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Pp.exports=l8(),Pp.exports}var _y;function c8(){if(_y)return Kc;_y=1;var e=Gk();return Kc.createRoot=e.createRoot,Kc.hydrateRoot=e.hydrateRoot,Kc}var d8=c8(),vi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},u8=class extends vi{#t;#e;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Hf=new u8,h8={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},p8=class{#t=h8;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,n){return this.#t.setTimeout(e,n)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,n){return this.#t.setInterval(e,n)}clearInterval(e){this.#t.clearInterval(e)}},li=new p8;function m8(e){setTimeout(e,0)}var f8=typeof window>"u"||"Deno"in globalThis;function Gt(){}function g8(e,n){return typeof e=="function"?e(n):e}function qm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Qk(e,n){return Math.max(e+(n||0)-Date.now(),0)}function Ir(e,n){return typeof e=="function"?e(n):e}function qn(e,n){return typeof e=="function"?e(n):e}function Dy(e,n){const{type:s="all",exact:r,fetchStatus:i,predicate:a,queryKey:l,stale:c}=e;if(l){if(r){if(n.queryHash!==Kf(l,n.options))return!1}else if(!Ho(n.queryKey,l))return!1}if(s!=="all"){const u=n.isActive();if(s==="active"&&!u||s==="inactive"&&u)return!1}return!(typeof c=="boolean"&&n.isStale()!==c||i&&i!==n.state.fetchStatus||a&&!a(n))}function By(e,n){const{exact:s,status:r,predicate:i,mutationKey:a}=e;if(a){if(!n.options.mutationKey)return!1;if(s){if(fi(n.options.mutationKey)!==fi(a))return!1}else if(!Ho(n.options.mutationKey,a))return!1}return!(r&&n.state.status!==r||i&&!i(n))}function Kf(e,n){return(n?.queryKeyHashFn||fi)(e)}function fi(e){return JSON.stringify(e,(n,s)=>Im(s)?Object.keys(s).sort().reduce((r,i)=>(r[i]=s[i],r),{}):s)}function Ho(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(s=>Ho(e[s],n[s])):!1}var x8=Object.prototype.hasOwnProperty;function Vf(e,n,s=0){if(e===n)return e;if(s>500)return n;const r=Wy(e)&&Wy(n);if(!r&&!(Im(e)&&Im(n)))return n;const a=(r?e:Object.keys(e)).length,l=r?n:Object.keys(n),c=l.length,u=r?new Array(c):{};let h=0;for(let m=0;m<c;m++){const p=r?m:l[m],x=e[p],g=n[p];if(x===g){u[p]=x,(r?m<a:x8.call(e,p))&&h++;continue}if(x===null||g===null||typeof x!="object"||typeof g!="object"){u[p]=g;continue}const j=Vf(x,g,s+1);u[p]=j,j===x&&h++}return a===c&&h===a?e:u}function Ko(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const s in e)if(e[s]!==n[s])return!1;return!0}function Wy(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Im(e){if(!Uy(e))return!1;const n=e.constructor;if(n===void 0)return!0;const s=n.prototype;return!(!Uy(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Uy(e){return Object.prototype.toString.call(e)==="[object Object]"}function y8(e){return new Promise(n=>{li.setTimeout(n,e)})}function Fm(e,n,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,n):s.structuralSharing!==!1?Vf(e,n):n}function j8(e){return e}function k8(e,n,s=0){const r=[...e,n];return s&&r.length>s?r.slice(1):r}function v8(e,n,s=0){const r=[n,...e];return s&&r.length>s?r.slice(0,-1):r}var Yf=Symbol();function Zk(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===Yf?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gf(e,n){return typeof e=="function"?e(...n):!!e}function b8(e,n,s){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=n(),r||(r=!0,i.aborted?s():i.addEventListener("abort",s,{once:!0})),i)}),e}var Vo=(()=>{let e=()=>f8;return{isServer(){return e()},setIsServer(n){e=n}}})();function Lm(){let e,n;const s=new Promise((i,a)=>{e=i,n=a});s.status="pending",s.catch(()=>{});function r(i){Object.assign(s,i),delete s.resolve,delete s.reject}return s.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},s.reject=i=>{r({status:"rejected",reason:i}),n(i)},s}var w8=m8;function N8(){let e=[],n=0,s=c=>{c()},r=c=>{c()},i=w8;const a=c=>{n?e.push(c):i(()=>{s(c)})},l=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(u=>{s(u)})})})};return{batch:c=>{let u;n++;try{u=c()}finally{n--,n||l()}return u},batchCalls:c=>(...u)=>{a(()=>{c(...u)})},schedule:a,setNotifyFunction:c=>{s=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var yt=N8(),S8=class extends vi{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#t}},vd=new S8;function C8(e){return Math.min(1e3*2**e,3e4)}function Xk(e){return(e??"online")==="online"?vd.isOnline():!0}var zm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Jk(e){let n=!1,s=0,r;const i=Lm(),a=()=>i.status!=="pending",l=k=>{if(!a()){const b=new zm(k);x(b),e.onCancel?.(b)}},c=()=>{n=!0},u=()=>{n=!1},h=()=>Hf.isFocused()&&(e.networkMode==="always"||vd.isOnline())&&e.canRun(),m=()=>Xk(e.networkMode)&&e.canRun(),p=k=>{a()||(r?.(),i.resolve(k))},x=k=>{a()||(r?.(),i.reject(k))},g=()=>new Promise(k=>{r=b=>{(a()||h())&&k(b)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),j=()=>{if(a())return;let k;const b=s===0?e.initialPromise:void 0;try{k=b??e.fn()}catch(w){k=Promise.reject(w)}Promise.resolve(k).then(p).catch(w=>{if(a())return;const S=e.retry??(Vo.isServer()?0:3),T=e.retryDelay??C8,E=typeof T=="function"?T(s,w):T,z=S===!0||typeof S=="number"&&s<S||typeof S=="function"&&S(s,w);if(n||!z){x(w);return}s++,e.onFail?.(s,w),y8(E).then(()=>h()?void 0:g()).then(()=>{n?x(w):j()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:u,canStart:m,start:()=>(m()?j():g().then(j),i)}}var ev=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qm(this.gcTime)&&(this.#t=li.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Vo.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#t!==void 0&&(li.clearTimeout(this.#t),this.#t=void 0)}};function $8(e){return{onFetch:(n,s)=>{const r=n.options,i=n.fetchOptions?.meta?.fetchMore?.direction,a=n.state.data?.pages||[],l=n.state.data?.pageParams||[];let c={pages:[],pageParams:[]},u=0;const h=async()=>{let m=!1;const p=j=>{b8(j,()=>n.signal,()=>m=!0)},x=Zk(n.options,n.fetchOptions),g=async(j,k,b)=>{if(m)return Promise.reject(n.signal.reason);if(k==null&&j.pages.length)return Promise.resolve(j);const S=(()=>{const $={client:n.client,queryKey:n.queryKey,pageParam:k,direction:b?"backward":"forward",meta:n.options.meta};return p($),$})(),T=await x(S),{maxPages:E}=n.options,z=b?v8:k8;return{pages:z(j.pages,T,E),pageParams:z(j.pageParams,k,E)}};if(i&&a.length){const j=i==="backward",k=j?T8:Hy,b={pages:a,pageParams:l},w=k(r,b);c=await g(b,w,j)}else{const j=e??a.length;do{const k=u===0?l[0]??r.initialPageParam:Hy(r,c);if(u>0&&k==null)break;c=await g(c,k),u++}while(u<j)}return c};n.options.persister?n.fetchFn=()=>n.options.persister?.(h,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},s):n.fetchFn=h}}}function Hy(e,{pages:n,pageParams:s}){const r=n.length-1;return n.length>0?e.getNextPageParam(n[r],n,s[r],s):void 0}function T8(e,{pages:n,pageParams:s}){return n.length>0?e.getPreviousPageParam?.(n[0],n,s[0],s):void 0}var E8=class extends ev{#t;#e;#n;#s;#r;#i;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#s=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Vy(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#t}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#t=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Vy(this.options);n.data!==void 0&&(this.setState(Ky(n.data,n.dataUpdatedAt)),this.#e=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(e,n){const s=Fm(this.state.data,e,this.options);return this.#l({data:s,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),s}setState(e){this.#l({type:"setState",state:e})}cancel(e){const n=this.#i?.promise;return this.#i?.cancel(e),n?n.then(Gt).catch(Gt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>qn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Yf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ir(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Qk(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#i&&(this.#a||this.#d()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#d(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const u=this.observers.find(h=>h.options.queryFn);u&&this.setOptions(u.options)}const s=new AbortController,r=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#a=!0,s.signal)})},i=()=>{const u=Zk(this.options,n),m=(()=>{const p={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#a=!1,this.options.persister?this.options.persister(u,m,this):u(m)},l=(()=>{const u={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(u),u})();(this.#t==="infinite"?$8(this.options.pages):this.options.behavior)?.onFetch(l,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#l({type:"fetch",meta:l.fetchOptions?.meta}),this.#i=Jk({initialPromise:n?.initialPromise,fn:l.fetchFn,onCancel:u=>{u instanceof zm&&u.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.abort()},onFail:(u,h)=>{this.#l({type:"failed",failureCount:u,error:h})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const u=await this.#i.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#s.config.onSuccess?.(u,this),this.#s.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof zm){if(u.silent)return this.#i.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#l({type:"error",error:u}),this.#s.config.onError?.(u,this),this.#s.config.onSettled?.(this.state.data,u,this),u}finally{this.scheduleGc()}}#l(e){const n=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...tv(s.data,this.options),fetchMeta:e.meta??null};case"success":const r={...s,...Ky(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const i=e.error;return{...s,error:i,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=n(this.state),yt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:e})})}};function tv(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Xk(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ky(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Vy(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,s=n!==void 0,r=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Qf=class extends vi{constructor(e,n){super(),this.options=n,this.#t=e,this.#a=null,this.#o=Lm(),this.bindMethods(),this.setOptions(n)}#t;#e=void 0;#n=void 0;#s=void 0;#r;#i;#o;#a;#d;#l;#p;#u;#m;#c;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Yy(this.#e,this.options)?this.#h():this.updateResult(),this.#j())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Mm(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Mm(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#k(),this.#v(),this.#e.removeObserver(this)}setOptions(e){const n=this.options,s=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#b(),this.#e.setOptions(this.options),n._defaulted&&!Ko(this.options,n)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&Gy(this.#e,s,this.options,n)&&this.#h(),this.updateResult(),r&&(this.#e!==s||qn(this.options.enabled,this.#e)!==qn(n.enabled,this.#e)||Ir(this.options.staleTime,this.#e)!==Ir(n.staleTime,this.#e))&&this.#g();const i=this.#x();r&&(this.#e!==s||qn(this.options.enabled,this.#e)!==qn(n.enabled,this.#e)||i!==this.#c)&&this.#y(i)}getOptimisticResult(e){const n=this.#t.getQueryCache().build(this.#t,e),s=this.createResult(n,e);return P8(this,s)&&(this.#s=s,this.#i=this.options,this.#r=this.#e.state),s}getCurrentResult(){return this.#s}trackResult(e,n){return new Proxy(e,{get:(s,r)=>(this.trackProp(r),n?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(e){this.#f.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#t.defaultQueryOptions(e),s=this.#t.getQueryCache().build(this.#t,n);return s.fetch().then(()=>this.createResult(s,n))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#h(e){this.#b();let n=this.#e.fetch(this.options,e);return e?.throwOnError||(n=n.catch(Gt)),n}#g(){this.#k();const e=Ir(this.options.staleTime,this.#e);if(Vo.isServer()||this.#s.isStale||!qm(e))return;const s=Qk(this.#s.dataUpdatedAt,e)+1;this.#u=li.setTimeout(()=>{this.#s.isStale||this.updateResult()},s)}#x(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#v(),this.#c=e,!(Vo.isServer()||qn(this.options.enabled,this.#e)===!1||!qm(this.#c)||this.#c===0)&&(this.#m=li.setInterval(()=>{(this.options.refetchIntervalInBackground||Hf.isFocused())&&this.#h()},this.#c))}#j(){this.#g(),this.#y(this.#x())}#k(){this.#u!==void 0&&(li.clearTimeout(this.#u),this.#u=void 0)}#v(){this.#m!==void 0&&(li.clearInterval(this.#m),this.#m=void 0)}createResult(e,n){const s=this.#e,r=this.options,i=this.#s,a=this.#r,l=this.#i,u=e!==s?e.state:this.#n,{state:h}=e;let m={...h},p=!1,x;if(n._optimisticResults){const L=this.hasListeners(),W=!L&&Yy(e,n),F=L&&Gy(e,s,n,r);(W||F)&&(m={...m,...tv(h.data,e.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:g,errorUpdatedAt:j,status:k}=m;x=m.data;let b=!1;if(n.placeholderData!==void 0&&x===void 0&&k==="pending"){let L;i?.isPlaceholderData&&n.placeholderData===l?.placeholderData?(L=i.data,b=!0):L=typeof n.placeholderData=="function"?n.placeholderData(this.#p?.state.data,this.#p):n.placeholderData,L!==void 0&&(k="success",x=Fm(i?.data,L,n),p=!0)}if(n.select&&x!==void 0&&!b)if(i&&x===a?.data&&n.select===this.#d)x=this.#l;else try{this.#d=n.select,x=n.select(x),x=Fm(i?.data,x,n),this.#l=x,this.#a=null}catch(L){this.#a=L}this.#a&&(g=this.#a,x=this.#l,j=Date.now(),k="error");const w=m.fetchStatus==="fetching",S=k==="pending",T=k==="error",E=S&&w,z=x!==void 0,P={status:k,fetchStatus:m.fetchStatus,isPending:S,isSuccess:k==="success",isError:T,isInitialLoading:E,isLoading:E,data:x,dataUpdatedAt:m.dataUpdatedAt,error:g,errorUpdatedAt:j,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:m.dataUpdateCount>u.dataUpdateCount||m.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:T&&!z,isPaused:m.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:T&&z,isStale:Zf(e,n),refetch:this.refetch,promise:this.#o,isEnabled:qn(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const L=P.data!==void 0,W=P.status==="error"&&!L,F=D=>{W?D.reject(P.error):L&&D.resolve(P.data)},U=()=>{const D=this.#o=P.promise=Lm();F(D)},I=this.#o;switch(I.status){case"pending":e.queryHash===s.queryHash&&F(I);break;case"fulfilled":(W||P.data!==I.value)&&U();break;case"rejected":(!W||P.error!==I.reason)&&U();break}}return P}updateResult(){const e=this.#s,n=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#i=this.options,this.#r.data!==void 0&&(this.#p=this.#e),Ko(n,e))return;this.#s=n;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#f.size)return!0;const a=new Set(i??this.#f);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(l=>{const c=l;return this.#s[c]!==e[c]&&a.has(c)})};this.#w({listeners:s()})}#b(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const n=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#j()}#w(e){yt.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(this.#s)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function A8(e,n){return qn(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&qn(n.retryOnMount,e)===!1)}function Yy(e,n){return A8(e,n)||e.state.data!==void 0&&Mm(e,n,n.refetchOnMount)}function Mm(e,n,s){if(qn(n.enabled,e)!==!1&&Ir(n.staleTime,e)!=="static"){const r=typeof s=="function"?s(e):s;return r==="always"||r!==!1&&Zf(e,n)}return!1}function Gy(e,n,s,r){return(e!==n||qn(r.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Zf(e,s)}function Zf(e,n){return qn(n.enabled,e)!==!1&&e.isStaleByTime(Ir(n.staleTime,e))}function P8(e,n){return!Ko(e.getCurrentResult(),n)}var R8=class extends ev{#t;#e;#n;#s;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||nv(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(n=>n!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#r({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Jk({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(a,l)=>{this.#r({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#r({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#s.canStart();try{if(r)n();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,s);const l=await this.options.onMutate?.(e,s);l!==this.state.context&&this.#r({type:"pending",context:l,variables:e,isPaused:i})}const a=await this.#s.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,s),await this.options.onSuccess?.(a,e,this.state.context,s),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(a,null,e,this.state.context,s),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,s)}catch(l){Promise.reject(l)}try{await this.options.onError?.(a,e,this.state.context,s)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,s)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,s)}catch(l){Promise.reject(l)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(e){const n=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),yt.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function nv(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var q8=class extends vi{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,n,s){const r=new R8({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:s});return this.add(r),r}add(e){this.#t.add(e);const n=Vc(e);if(typeof n=="string"){const s=this.#e.get(n);s?s.push(e):this.#e.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const n=Vc(e);if(typeof n=="string"){const s=this.#e.get(n);if(s)if(s.length>1){const r=s.indexOf(e);r!==-1&&s.splice(r,1)}else s[0]===e&&this.#e.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Vc(e);if(typeof n=="string"){const r=this.#e.get(n)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const n=Vc(e);return typeof n=="string"?this.#e.get(n)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){yt.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const n={exact:!0,...e};return this.getAll().find(s=>By(n,s))}findAll(e={}){return this.getAll().filter(n=>By(e,n))}notify(e){yt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return yt.batch(()=>Promise.all(e.map(n=>n.continue().catch(Gt))))}};function Vc(e){return e.options.scope?.id}var I8=class extends vi{#t;#e=void 0;#n;#s;constructor(n,s){super(),this.#t=n,this.setOptions(s),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){const s=this.options;this.options=this.#t.defaultMutationOptions(n),Ko(this.options,s)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),s?.mutationKey&&this.options.mutationKey&&fi(s.mutationKey)!==fi(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(n){this.#r(),this.#i(n)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#i()}mutate(n,s){return this.#s=s,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(n)}#r(){const n=this.#n?.state??nv();this.#e={...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset}}#i(n){yt.batch(()=>{if(this.#s&&this.hasListeners()){const s=this.#e.variables,r=this.#e.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(n?.type==="success"){try{this.#s.onSuccess?.(n.data,s,r,i)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(n.data,null,s,r,i)}catch(a){Promise.reject(a)}}else if(n?.type==="error"){try{this.#s.onError?.(n.error,s,r,i)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(void 0,n.error,s,r,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(s=>{s(this.#e)})})}};function Qy(e,n){const s=new Set(n);return e.filter(r=>!s.has(r))}function F8(e,n,s){const r=e.slice(0);return r[n]=s,r}var L8=class extends vi{#t;#e;#n;#s;#r;#i;#o;#a;#d;#l=[];constructor(e,n,s){super(),this.#t=e,this.#s=s,this.#n=[],this.#r=[],this.#e=[],this.setQueries(n)}onSubscribe(){this.listeners.size===1&&this.#r.forEach(e=>{e.subscribe(n=>{this.#f(e,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(e=>{e.destroy()})}setQueries(e,n){this.#n=e,this.#s=n,yt.batch(()=>{const s=this.#r,r=this.#c(this.#n);r.forEach(m=>m.observer.setOptions(m.defaultedQueryOptions));const i=r.map(m=>m.observer),a=i.map(m=>m.getCurrentResult()),l=s.length!==i.length,c=i.some((m,p)=>m!==s[p]),u=l||c,h=u?!0:a.some((m,p)=>{const x=this.#e[p];return!x||!Ko(m,x)});!u&&!h||(u&&(this.#l=r,this.#r=i),this.#e=a,this.hasListeners()&&(u&&(Qy(s,i).forEach(m=>{m.destroy()}),Qy(i,s).forEach(m=>{m.subscribe(p=>{this.#f(m,p)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,n){const s=this.#c(e),r=s.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=s.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#u(a??r,n,i),()=>this.#p(r,s)]}#p(e,n){return n.map((s,r)=>{const i=e[r];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,a=>{n.forEach(l=>{l.observer.trackProp(a)})})})}#u(e,n,s){if(n){const r=this.#d,i=s!==void 0&&r!==void 0&&(r.length!==s.length||s.some((a,l)=>a!==r[l]));return(!this.#i||this.#e!==this.#a||i||n!==this.#o)&&(this.#o=n,this.#a=this.#e,s!==void 0&&(this.#d=s),this.#i=Vf(this.#i,n(e))),this.#i}return e}#m(){return this.#s?.combine!==void 0&&this.#r.some((e,n)=>e.options.suspense&&this.#e[n]?.data===void 0)}#c(e){const n=new Map;this.#r.forEach(r=>{const i=r.options.queryHash;if(!i)return;const a=n.get(i);a?a.push(r):n.set(i,[r])});const s=[];return e.forEach(r=>{const i=this.#t.defaultQueryOptions(r),l=n.get(i.queryHash)?.shift()??new Qf(this.#t,i);s.push({defaultedQueryOptions:i,observer:l})}),s}#f(e,n){const s=this.#r.indexOf(e);s!==-1&&(this.#e=F8(this.#e,s,n),this.#h())}#h(){if(this.hasListeners()){const e=this.#p(this.#e,this.#l),n=this.#m(),s=this.#i,r=n?s:this.#u(e,this.#s?.combine);(n||s!==r)&&yt.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}},z8=class extends vi{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,n,s){const r=n.queryKey,i=n.queryHash??Kf(r,n);let a=this.get(i);return a||(a=new E8({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(n),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#t.get(e.queryHash);n&&(e.destroy(),n===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){yt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(s=>Dy(n,s))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(s=>Dy(e,s)):n}notify(e){yt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){yt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){yt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},M8=class{#t;#e;#n;#s;#r;#i;#o;#a;constructor(e={}){this.#t=e.queryCache||new z8,this.#e=e.mutationCache||new q8,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=Hf.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#a=vd.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#t.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),s=this.#t.build(this,n),r=s.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Ir(n.staleTime,s))&&this.prefetchQuery(n),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:n,state:s})=>{const r=s.data;return[n,r]})}setQueryData(e,n,s){const r=this.defaultQueryOptions({queryKey:e}),a=this.#t.get(r.queryHash)?.state.data,l=g8(n,a);if(l!==void 0)return this.#t.build(this,r).setData(l,{...s,manual:!0})}setQueriesData(e,n,s){return yt.batch(()=>this.#t.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,n,s)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#t.get(n.queryHash)?.state}removeQueries(e){const n=this.#t;yt.batch(()=>{n.findAll(e).forEach(s=>{n.remove(s)})})}resetQueries(e,n){const s=this.#t;return yt.batch(()=>(s.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const s={revert:!0,...n},r=yt.batch(()=>this.#t.findAll(e).map(i=>i.cancel(s)));return Promise.all(r).then(Gt).catch(Gt)}invalidateQueries(e,n={}){return yt.batch(()=>(this.#t.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const s={...n,cancelRefetch:n.cancelRefetch??!0},r=yt.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,s);return s.throwOnError||(a=a.catch(Gt)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Gt)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const s=this.#t.build(this,n);return s.isStaleByTime(Ir(n.staleTime,s))?s.fetch(n):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Gt).catch(Gt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Gt).catch(Gt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return vd.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#s.set(fi(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#s.values()],s={};return n.forEach(r=>{Ho(e,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(e,n){this.#r.set(fi(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#r.values()],s={};return n.forEach(r=>{Ho(e,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=Kf(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Yf&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},sv=N.createContext(void 0),Ot=e=>{const n=N.useContext(sv);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},O8=({client:e,children:n})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),t.jsx(sv.Provider,{value:e,children:n})),rv=N.createContext(!1),iv=()=>N.useContext(rv);rv.Provider;function _8(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var D8=N.createContext(_8()),av=()=>N.useContext(D8),ov=(e,n,s)=>{const r=s?.state.error&&typeof e.throwOnError=="function"?Gf(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(n.isReset()||(e.retryOnMount=!1))},lv=e=>{N.useEffect(()=>{e.clearReset()},[e])},cv=({result:e,errorResetBoundary:n,throwOnError:s,query:r,suspense:i})=>e.isError&&!n.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Gf(s,[e.error,r])),dv=e=>{if(e.suspense){const s=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>s(r(...i)):s(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},B8=(e,n)=>e.isLoading&&e.isFetching&&!n,Om=(e,n)=>e?.suspense&&n.isPending,_m=(e,n,s)=>n.fetchOptimistic(e).catch(()=>{s.clearReset()});function W8({queries:e,...n},s){const r=Ot(),i=iv(),a=av(),l=N.useMemo(()=>e.map(k=>{const b=r.defaultQueryOptions(k);return b._optimisticResults=i?"isRestoring":"optimistic",b}),[e,r,i]);l.forEach(k=>{dv(k);const b=r.getQueryCache().get(k.queryHash);ov(k,a,b)}),lv(a);const[c]=N.useState(()=>new L8(r,l,n)),[u,h,m]=c.getOptimisticResult(l,n.combine),p=!i&&n.subscribed!==!1;N.useSyncExternalStore(N.useCallback(k=>p?c.subscribe(yt.batchCalls(k)):Gt,[c,p]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),N.useEffect(()=>{c.setQueries(l,n)},[l,n,c]);const g=u.some((k,b)=>Om(l[b],k))?u.flatMap((k,b)=>{const w=l[b];if(w&&Om(w,k)){const S=new Qf(r,w);return _m(w,S,a)}return[]}):[];if(g.length>0)throw Promise.all(g);const j=u.find((k,b)=>{const w=l[b];return w&&cv({result:k,errorResetBoundary:a,throwOnError:w.throwOnError,query:r.getQueryCache().get(w.queryHash),suspense:w.suspense})});if(j?.error)throw j.error;return h(m())}function U8(e,n,s){const r=iv(),i=av(),a=Ot(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const c=a.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",dv(l),ov(l,i,c),lv(i);const u=!a.getQueryCache().get(l.queryHash),[h]=N.useState(()=>new n(a,l)),m=h.getOptimisticResult(l),p=!r&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(x=>{const g=p?h.subscribe(yt.batchCalls(x)):Gt;return h.updateResult(),g},[h,p]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),N.useEffect(()=>{h.setOptions(l)},[l,h]),Om(l,m))throw _m(l,h,i);if(cv({result:m,errorResetBoundary:i,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw m.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(l,m),l.experimental_prefetchInRender&&!Vo.isServer()&&B8(m,r)&&(u?_m(l,h,i):c?.promise)?.catch(Gt).finally(()=>{h.updateResult()}),l.notifyOnChangeProps?m:h.trackResult(m)}function ve(e,n){return U8(e,Qf)}function yl(e,n){const s=Ot(),[r]=N.useState(()=>new I8(s,e));N.useEffect(()=>{r.setOptions(e)},[r,e]);const i=N.useSyncExternalStore(N.useCallback(l=>r.subscribe(yt.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=N.useCallback((l,c)=>{r.mutate(l,c).catch(Gt)},[r]);if(i.error&&Gf(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Io=typeof window<"u"?N.useLayoutEffect:N.useEffect;function Ip(e){const n=N.useRef({value:e,prev:null}),s=n.current.value;return e!==s&&(n.current={value:e,prev:s}),n.current.prev}function H8(e,n,s={},r={}){N.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([a])=>{n(a)},s);return i.observe(e.current),()=>{i.disconnect()}},[n,s,r.disabled,e])}function K8(e){const n=N.useRef(null);return N.useImperativeHandle(e,()=>n.current,[]),n}const uv=!1;function Yo(e){return e[e.length-1]}function V8(e){return typeof e=="function"}function Ar(e,n){return V8(e)?e(n):e}const hv=Object.prototype.hasOwnProperty,Zy=Object.prototype.propertyIsEnumerable;function pv(e){for(const n in e)if(hv.call(e,n))return!0;return!1}const Y8=()=>Object.create(null),ri=(e,n)=>Pr(e,n,Y8);function Pr(e,n,s=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const i=n,a=ej(e)&&ej(i);if(!a&&!(ma(e)&&ma(i)))return i;const l=a?e:Xy(e);if(!l)return i;const c=a?i:Xy(i);if(!c)return i;const u=l.length,h=c.length,m=a?new Array(h):s();let p=0;for(let x=0;x<h;x++){const g=a?x:c[x],j=e[g],k=i[g];if(j===k){m[g]=j,(a?x<u:hv.call(e,g))&&p++;continue}if(j===null||k===null||typeof j!="object"||typeof k!="object"){m[g]=k;continue}const b=Pr(j,k,s,r+1);m[g]=b,b===j&&p++}return u===h&&p===u?e:m}function Xy(e){const n=Object.getOwnPropertyNames(e);for(const i of n)if(!Zy.call(e,i))return!1;const s=Object.getOwnPropertySymbols(e);if(s.length===0)return n;const r=n;for(const i of s){if(!Zy.call(e,i))return!1;r.push(i)}return r}function ma(e){if(!Jy(e))return!1;const n=e.constructor;if(typeof n>"u")return!0;const s=n.prototype;return!(!Jy(s)||!s.hasOwnProperty("isPrototypeOf"))}function Jy(e){return Object.prototype.toString.call(e)==="[object Object]"}function ej(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function di(e,n,s){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!di(e[r],n[r],s))return!1;return!0}if(ma(e)&&ma(n)){const r=s?.ignoreUndefined??!0;if(s?.partial){for(const l in n)if((!r||n[l]!==void 0)&&!di(e[l],n[l],s))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let a=0;for(const l in n)if((!r||n[l]!==void 0)&&(a++,a>i||!di(e[l],n[l],s)))return!1;return i===a}return!1}function fa(e){let n,s;const r=new Promise((i,a)=>{n=i,s=a});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,n(i),e?.(i)},r.reject=i=>{r.status="rejected",s(i)},r}function Go(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function G8(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function tj(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return G8(n)}const Q8=["http:","https:","mailto:","tel:"];function bd(e,n){if(!e)return!1;try{const s=new URL(e);return!n.has(s.protocol)}catch{return!1}}function So(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let s=0,r="",i;for(;(i=n.exec(e))!==null;)r+=tj(e.slice(s,i.index))+i[0],s=n.lastIndex;r=r+tj(s?e.slice(s):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function Z8(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function X8(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let s=0;s<e.length;s++)if(e[s]!==n[s])return!1;return!0}function Qs(){throw new Error("Invariant failed")}function Qo(e){const n=new Map;let s,r;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,s=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const l=n.get(a);if(l)return i(l),l.value},set(a,l){if(n.size>=e&&s){const u=s;n.delete(u.key),u.next&&(s=u.next,u.next.prev=void 0),u===r&&(r=void 0)}const c=n.get(a);if(c)c.value=l,i(c);else{const u={key:a,value:l,prev:r};r&&(r.next=u),r=u,s||(s=u),n.set(a,u)}},clear(){n.clear(),s=void 0,r=void 0}}}const Rr=4,mv=5;function J8(e){const n=e.indexOf("{");if(n===-1)return null;const s=e.indexOf("}",n);return s===-1||n+1>=e.length?null:[n,s]}function fv(e,n,s=new Uint16Array(6)){const r=e.indexOf("/",n),i=r===-1?e.length:r,a=e.substring(n,i);if(!a||!a.includes("$"))return s[0]=0,s[1]=n,s[2]=n,s[3]=i,s[4]=i,s[5]=i,s;if(a==="$"){const c=e.length;return s[0]=2,s[1]=n,s[2]=n,s[3]=c,s[4]=c,s[5]=c,s}if(a.charCodeAt(0)===36)return s[0]=1,s[1]=n,s[2]=n+1,s[3]=i,s[4]=i,s[5]=i,s;const l=J8(a);if(l){const[c,u]=l,h=a.charCodeAt(c+1);if(h===45){if(c+2<a.length&&a.charCodeAt(c+2)===36){const m=c+3,p=u;if(m<p)return s[0]=3,s[1]=n+c,s[2]=n+m,s[3]=n+p,s[4]=n+u+1,s[5]=i,s}}else if(h===36){const m=c+1,p=c+2;return p===u?(s[0]=2,s[1]=n+c,s[2]=n+m,s[3]=n+p,s[4]=n+u+1,s[5]=e.length,s):(s[0]=1,s[1]=n+c,s[2]=n+p,s[3]=n+u,s[4]=n+u+1,s[5]=i,s)}}return s[0]=0,s[1]=n,s[2]=n,s[3]=i,s[4]=i,s[5]=i,s}function ou(e,n,s,r,i,a,l){l?.(s);let c=r;{const u=s.fullPath??s.from,h=u.length,m=s.options?.caseSensitive??e,p=s.options?.params?.parse??s.options?.parseParams;for(;c<h;){const g=fv(u,c,n);let j;const k=c,b=g[5];switch(c=b+1,a++,g[0]){case 0:{const w=u.substring(g[2],g[3]);if(m){const S=i.static?.get(w);if(S)j=S;else{i.static??=new Map;const T=ci(s.fullPath??s.from);T.parent=i,T.depth=a,j=T,i.static.set(w,T)}}else{const S=w.toLowerCase(),T=i.staticInsensitive?.get(S);if(T)j=T;else{i.staticInsensitive??=new Map;const E=ci(s.fullPath??s.from);E.parent=i,E.depth=a,j=E,i.staticInsensitive.set(S,E)}}break}case 1:{const w=u.substring(k,g[1]),S=u.substring(g[4],b),T=m&&!!(w||S),E=w?T?w:w.toLowerCase():void 0,z=S?T?S:S.toLowerCase():void 0,$=!p&&i.dynamic?.find(P=>!P.parse&&P.caseSensitive===T&&P.prefix===E&&P.suffix===z);if($)j=$;else{const P=Lp(1,s.fullPath??s.from,T,E,z);j=P,P.depth=a,P.parent=i,i.dynamic??=[],i.dynamic.push(P)}break}case 3:{const w=u.substring(k,g[1]),S=u.substring(g[4],b),T=m&&!!(w||S),E=w?T?w:w.toLowerCase():void 0,z=S?T?S:S.toLowerCase():void 0,$=!p&&i.optional?.find(P=>!P.parse&&P.caseSensitive===T&&P.prefix===E&&P.suffix===z);if($)j=$;else{const P=Lp(3,s.fullPath??s.from,T,E,z);j=P,P.parent=i,P.depth=a,i.optional??=[],i.optional.push(P)}break}case 2:{const w=u.substring(k,g[1]),S=u.substring(g[4],b),T=m&&!!(w||S),E=w?T?w:w.toLowerCase():void 0,z=S?T?S:S.toLowerCase():void 0,$=Lp(2,s.fullPath??s.from,T,E,z);j=$,$.parent=i,$.depth=a,i.wildcard??=[],i.wildcard.push($)}}i=j}if(p&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const g=ci(s.fullPath??s.from);g.kind=mv,g.parent=i,a++,g.depth=a,i.pathless??=[],i.pathless.push(g),i=g}const x=(s.path||!s.children)&&!s.isRoot;if(x&&u.endsWith("/")){const g=ci(s.fullPath??s.from);g.kind=Rr,g.parent=i,a++,g.depth=a,i.index=g,i=g}i.parse=p??null,x&&!i.route&&(i.route=s,i.fullPath=s.fullPath??s.from)}if(s.children)for(const u of s.children)ou(e,n,u,c,i,a,l)}function Fp(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function $r(e){if(e.pathless)for(const n of e.pathless)$r(n);if(e.static)for(const n of e.static.values())$r(n);if(e.staticInsensitive)for(const n of e.staticInsensitive.values())$r(n);if(e.dynamic?.length){e.dynamic.sort(Fp);for(const n of e.dynamic)$r(n)}if(e.optional?.length){e.optional.sort(Fp);for(const n of e.optional)$r(n)}if(e.wildcard?.length){e.wildcard.sort(Fp);for(const n of e.wildcard)$r(n)}}function ci(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null}}function Lp(e,n,s,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,caseSensitive:s,prefix:r,suffix:i}}function e7(e,n){const s=ci("/"),r=new Uint16Array(6);for(const i of e)ou(!1,r,i,1,s,0);$r(s),n.masksTree=s,n.flatCache=Qo(1e3)}function t7(e,n){e||="/";const s=n.flatCache.get(e);if(s)return s;const r=Xf(e,n.masksTree);return n.flatCache.set(e,r),r}function n7(e,n,s,r,i){e||="/",r||="/";const a=n?`case\0${e}`:e;let l=i.singleCache.get(a);return l||(l=ci("/"),ou(n,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(a,l)),Xf(r,l,s)}function s7(e,n,s=!1){const r=s?e:`nofuzz\0${e}`,i=n.matchCache.get(r);if(i!==void 0)return i;e||="/";let a;try{a=Xf(e,n.segmentTree,s)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=xv(a.route)),n.matchCache.set(r,a),a}function r7(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function i7(e,n=!1,s){const r=ci(e.fullPath),i=new Uint16Array(6),a={},l={};let c=0;return ou(n,i,e,1,r,0,u=>{if(s?.(u,c),u.id in a&&Qs(),a[u.id]=u,c!==0&&u.path){const h=r7(u.fullPath);(!l[h]||u.fullPath.endsWith("/"))&&(l[h]=u)}c++}),$r(r),{processedTree:{segmentTree:r,singleCache:Qo(1e3),matchCache:Qo(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function Xf(e,n,s=!1){const r=e.split("/"),i=o7(e,r,n,s);if(!i)return null;const[a]=gv(e,r,i);return{route:i.node.route,rawParams:a}}function gv(e,n,s){const r=a7(s.node);let i=null;const a=Object.create(null);let l=s.extract?.part??0,c=s.extract?.node??0,u=s.extract?.path??0,h=s.extract?.segment??0;for(;c<r.length;l++,c++,u++,h++){const m=r[c];if(m.kind===Rr)break;if(m.kind===mv){h--,l--,u--;continue}const p=n[l],x=u;if(p&&(u+=p.length),m.kind===1){i??=s.node.fullPath.split("/");const g=i[h],j=m.prefix?.length??0;if(g.charCodeAt(j)===123){const k=m.suffix?.length??0,b=g.substring(j+2,g.length-k-1),w=p.substring(j,p.length-k);a[b]=decodeURIComponent(w)}else{const k=g.substring(1);a[k]=decodeURIComponent(p)}}else if(m.kind===3){if(s.skipped&1<<c){l--,u=x-1;continue}i??=s.node.fullPath.split("/");const g=i[h],j=m.prefix?.length??0,k=m.suffix?.length??0,b=g.substring(j+3,g.length-k-1),w=m.suffix||m.prefix?p.substring(j,p.length-k):p;w&&(a[b]=decodeURIComponent(w))}else if(m.kind===2){const g=m,j=e.substring(x+(g.prefix?.length??0),e.length-(g.suffix?.length??0)),k=decodeURIComponent(j);a["*"]=k,a._splat=k;break}}return s.rawParams&&Object.assign(a,s.rawParams),[a,{part:l,node:c,path:u,segment:h}]}function xv(e){const n=[e];for(;e.parentRoute;)e=e.parentRoute,n.push(e);return n.reverse(),n}function a7(e){const n=Array(e.depth+1);do n[e.depth]=e,e=e.parent;while(e);return n}function o7(e,n,s,r){if(e==="/"&&s.index)return{node:s.index,skipped:0};const i=!Yo(n),a=i&&e!=="/",l=n.length-(i?1:0),c=[{node:s,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let u=null,h=null;for(;c.length;){const m=c.pop(),{node:p,index:x,skipped:g,depth:j,statics:k,dynamics:b,optionals:w}=m;let{extract:S,rawParams:T}=m;if(p.kind===2&&p.route&&!Gc(h,m))continue;if(p.parse){if(!nj(e,n,m))continue;T=m.rawParams,S=m.extract}r&&p.route&&p.kind!==Rr&&Gc(u,m)&&(u=m);const E=x===l;if(E&&(p.route&&(!a||p.kind===Rr||p.kind===2)&&Gc(h,m)&&(h=m),!p.optional&&!p.wildcard&&!p.index&&!p.pathless))continue;const z=E?void 0:n[x];let $;if(E&&p.index){const P={node:p.index,index:x,skipped:g,depth:j+1,statics:k,dynamics:b,optionals:w,extract:S,rawParams:T};let L=!0;if(p.index.parse&&(nj(e,n,P)||(L=!1)),L){if(!b&&!w&&!g&&l7(k,l))return P;Gc(h,P)&&(h=P)}}if(p.wildcard)for(let P=p.wildcard.length-1;P>=0;P--){const L=p.wildcard[P],{prefix:W,suffix:F}=L;if(!(W&&(E||!(L.caseSensitive?z:$??=z.toLowerCase()).startsWith(W)))){if(F){if(E)continue;const U=n.slice(x).join("/").slice(-F.length);if((L.caseSensitive?U:U.toLowerCase())!==F)continue}c.push({node:L,index:l,skipped:g,depth:j+1,statics:k,dynamics:b,optionals:w,extract:S,rawParams:T})}}if(p.optional){const P=g|1<<j,L=j+1;for(let W=p.optional.length-1;W>=0;W--){const F=p.optional[W];c.push({node:F,index:x,skipped:P,depth:L,statics:k,dynamics:b,optionals:w,extract:S,rawParams:T})}if(!E)for(let W=p.optional.length-1;W>=0;W--){const F=p.optional[W],{prefix:U,suffix:I}=F;if(U||I){const D=F.caseSensitive?z:$??=z.toLowerCase();if(U&&!D.startsWith(U)||I&&!D.endsWith(I))continue}c.push({node:F,index:x+1,skipped:g,depth:L,statics:k,dynamics:b,optionals:w+Yc(l,x),extract:S,rawParams:T})}}if(!E&&p.dynamic&&z)for(let P=p.dynamic.length-1;P>=0;P--){const L=p.dynamic[P],{prefix:W,suffix:F}=L;if(W||F){const U=L.caseSensitive?z:$??=z.toLowerCase();if(W&&!U.startsWith(W)||F&&!U.endsWith(F))continue}c.push({node:L,index:x+1,skipped:g,depth:j+1,statics:k,dynamics:b+Yc(l,x),optionals:w,extract:S,rawParams:T})}if(!E&&p.staticInsensitive){const P=p.staticInsensitive.get($??=z.toLowerCase());P&&c.push({node:P,index:x+1,skipped:g,depth:j+1,statics:k+Yc(l,x),dynamics:b,optionals:w,extract:S,rawParams:T})}if(!E&&p.static){const P=p.static.get(z);P&&c.push({node:P,index:x+1,skipped:g,depth:j+1,statics:k+Yc(l,x),dynamics:b,optionals:w,extract:S,rawParams:T})}if(p.pathless){const P=j+1;for(let L=p.pathless.length-1;L>=0;L--){const W=p.pathless[L];c.push({node:W,index:x,skipped:g,depth:P,statics:k,dynamics:b,optionals:w,extract:S,rawParams:T})}}}if(h)return h;if(r&&u){let m=u.index;for(let x=0;x<u.index;x++)m+=n[x].length;const p=m===e.length?"/":e.slice(m);return u.rawParams??=Object.create(null),u.rawParams["**"]=decodeURIComponent(p),u}return null}function Yc(e,n){return 2**(e-n-1)}function l7(e,n){return e===2**(n-1)-1}function nj(e,n,s){let r,i;try{[r,i]=gv(e,n,s)}catch{return null}if(s.rawParams=r,s.extract=i,!s.node.parse)return!0;try{if(s.node.parse(r)===!1)return null}catch{}return!0}function Gc(e,n){return e?n.statics>e.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===Rr)>(e.node.kind===Rr)||n.node.kind===Rr==(e.node.kind===Rr)&&n.depth>e.depth))):!0}function ud(e){return Jf(e.filter(n=>n!==void 0).join("/"))}function Jf(e){return e.replace(/\/{2,}/g,"/")}function yv(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Gs(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function jv(e){return Gs(yv(e))}function wd(e,n){return e?.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function c7(e,n,s){return wd(e,s)===wd(n,s)}function d7({base:e,to:n,trailingSlash:s="never",cache:r}){const i=n.startsWith("/"),a=!i&&n===".";let l;if(r){l=i?n:a?e:e+"\0"+n;const h=r.get(l);if(h)return h}let c;if(a)c=e.split("/");else if(i)c=n.split("/");else{for(c=e.split("/");c.length>1&&Yo(c)==="";)c.pop();const h=n.split("/");for(let m=0,p=h.length;m<p;m++){const x=h[m];x===""?m?m===p-1&&c.push(x):c=[x]:x===".."?c.pop():x==="."||c.push(x)}}c.length>1&&(Yo(c)===""?s==="never"&&c.pop():s==="always"&&c.push(""));const u=Jf(c.join("/"))||"/";return l&&r&&r.set(l,u),u}function u7(e){const n=new Map(e.map(i=>[encodeURIComponent(i),i])),s=Array.from(n.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(s,"g");return i=>i.replace(r,a=>n.get(a)??a)}function zp(e,n,s){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(i=>rj(i,s)).join("/"):rj(r,s)}function sj({path:e,params:n,decoder:s,...r}){let i=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const l=e.length;let c=0,u,h="";for(;c<l;){const m=c;u=fv(e,m,u);const p=u[5];if(c=p+1,m===p)continue;const x=u[0];if(x===0){h+="/"+e.substring(m,p);continue}if(x===2){const g=n._splat;a._splat=g,a["*"]=g;const j=e.substring(m,u[1]),k=e.substring(u[4],p);if(!g){i=!0,(j||k)&&(h+="/"+j+k);continue}const b=zp("_splat",n,s);h+="/"+j+b+k;continue}if(x===1){const g=e.substring(u[2],u[3]);!i&&!(g in n)&&(i=!0),a[g]=n[g];const j=e.substring(m,u[1]),k=e.substring(u[4],p),b=zp(g,n,s)??"undefined";h+="/"+j+b+k;continue}if(x===3){const g=e.substring(u[2],u[3]),j=n[g];if(j==null)continue;a[g]=j;const k=e.substring(m,u[1]),b=e.substring(u[4],p),w=zp(g,n,s)??"";h+="/"+k+w+b;continue}}return e.endsWith("/")&&(h+="/"),{usedParams:a,interpolatedPath:h||"/",isMissingParams:i}}function rj(e,n){const s=encodeURIComponent(e);return n?.(s)??s}function Zt(e){return e?.isNotFound===!0}function h7(){try{return typeof window<"u"&&typeof window.sessionStorage=="object"?window.sessionStorage:void 0}catch{return}}const p7="tsr-scroll-restoration-v1_3";function m7(){const e=h7();if(!e)return null;let n={};try{const r=JSON.parse(e.getItem("tsr-scroll-restoration-v1_3")||"{}");ma(r)&&(n=r)}catch{}return{get state(){return n},set:r=>{n=Ar(r,n)||n},persist:()=>{try{e.setItem(p7,JSON.stringify(n))}catch{}}}}const ij=m7(),f7=e=>e.state.__TSR_key||e.href;function g7(e){const n=[];let s;for(;s=e.parentNode;)n.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,e)+1})`),e=s;return`${n.reverse().join(" > ")}`.toLowerCase()}let Qc=!1;const Co="window",aj="data-scroll-restoration-id";function x7(e,n){if(!ij)return;const s=ij;if((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!s)return;e.isScrollRestorationSetup=!0,Qc=!1;const r=e.options.getScrollRestorationKey||f7,i=new Map;window.history.scrollRestoration="manual";const a=c=>{if(!(Qc||!e.isScrollRestoring))if(c.target===document||c.target===window)i.set(Co,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{const u=c.target;i.set(u,{scrollX:u.scrollLeft||0,scrollY:u.scrollTop||0})}},l=c=>{if(!e.isScrollRestoring||!c||i.size===0||!s)return;const u=s.state[c]||={};for(const[h,m]of i){let p;if(h===Co)p=Co;else if(h.isConnected){const x=h.getAttribute(aj);p=x?`[${aj}="${x}"]`:g7(h)}p&&(u[p]=m)}};document.addEventListener("scroll",a,!0),e.subscribe("onBeforeLoad",c=>{l(c.fromLocation?r(c.fromLocation):void 0),i.clear()}),window.addEventListener("pagehide",()=>{l(r(e.stores.resolvedLocation.get()??e.stores.location.get())),s.persist()}),e.subscribe("onRendered",c=>{const u=r(c.toLocation),h=e.options.scrollRestorationBehavior,m=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))){Qc=!0;try{const p=e.isScrollRestoring?s.state[u]:void 0;let x=!1;if(p)for(const g in p){const j=p[g];if(!ma(j))continue;const{scrollX:k,scrollY:b}=j;if(!(!Number.isFinite(k)||!Number.isFinite(b))){if(g===Co)window.scrollTo({top:b,left:k,behavior:h}),x=!0;else if(g){let w;try{w=document.querySelector(g)}catch{continue}w&&(w.scrollLeft=k,w.scrollTop=b,x=!0)}}}if(!x){const g=e.history.location.hash.slice(1);if(g){const j=window.history.state?.__hashScrollIntoViewOptions??!0;if(j){const k=document.getElementById(g);k&&k.scrollIntoView(j)}}else{const j={top:0,left:0,behavior:h};if(window.scrollTo(j),m)for(const k of m){if(k===Co)continue;const b=typeof k=="function"?k():document.querySelector(k);b&&b.scrollTo(j)}}}}finally{Qc=!1}e.isScrollRestoring&&s.set(p=>(p[u]||={},p))}})}function y7(e,n=String){const s=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&s.set(r,n(i))}return s.toString()}function Mp(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function j7(e){const n=new URLSearchParams(e),s=Object.create(null);for(const[r,i]of n.entries()){const a=s[r];a==null?s[r]=Mp(i):Array.isArray(a)?a.push(Mp(i)):s[r]=[a,Mp(i)]}return s}const k7=b7(JSON.parse),v7=w7(JSON.stringify,JSON.parse);function b7(e){return n=>{n[0]==="?"&&(n=n.substring(1));const s=j7(n);for(const r in s){const i=s[r];if(typeof i=="string")try{s[r]=e(i)}catch{}}return s}}function w7(e,n){const s=typeof n=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(s&&typeof i=="string")try{return n(i),e(i)}catch{}return i}return i=>{const a=y7(i,r);return a?`?${a}`:""}}const ui="__root__";function jl(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const s=new Response(null,{status:e.statusCode,headers:n});if(s.options=e,e.throw)throw s;return s}function yn(e){return e instanceof Response&&!!e.options}function N7(e){return{input:({url:n})=>{for(const s of e)n=Dm(s,n);return n},output:({url:n})=>{for(let s=e.length-1;s>=0;s--)n=kv(e[s],n);return n}}}function S7(e){const n=jv(e.basepath),s=`/${n}`,r=`${s}/`,i=e.caseSensitive?s:s.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const c=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return c===i?l.pathname="/":c.startsWith(a)&&(l.pathname=l.pathname.slice(s.length)),l},output:({url:l})=>(l.pathname=ud(["/",n,l.pathname]),l)}}function Dm(e,n){const s=e?.input?.({url:n});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return n}function kv(e,n){const s=e?.output?.({url:n});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return n}function C7(e,n){const{createMutableStore:s,createReadonlyStore:r,batch:i,init:a}=n,l=new Map,c=new Map,u=new Map,h=s(e.status),m=s(e.loadedAt),p=s(e.isLoading),x=s(e.isTransitioning),g=s(e.location),j=s(e.resolvedLocation),k=s(e.statusCode),b=s(e.redirect),w=s([]),S=s([]),T=s([]),E=r(()=>Op(l,w.get())),z=r(()=>Op(c,S.get())),$=r(()=>Op(u,T.get())),P=r(()=>w.get()[0]),L=r(()=>w.get().some(H=>l.get(H)?.get().status==="pending")),W=r(()=>({locationHref:g.get().href,resolvedLocationHref:j.get()?.href,status:h.get()})),F=r(()=>({status:h.get(),loadedAt:m.get(),isLoading:p.get(),isTransitioning:x.get(),matches:E.get(),location:g.get(),resolvedLocation:j.get(),statusCode:k.get(),redirect:b.get()})),U=Qo(64);function I(H){let Z=U.get(H);return Z||(Z=r(()=>{const ue=w.get();for(const q of ue){const B=l.get(q);if(B&&B.routeId===H)return B.get()}}),U.set(H,Z)),Z}const D={status:h,loadedAt:m,isLoading:p,isTransitioning:x,location:g,resolvedLocation:j,statusCode:k,redirect:b,matchesId:w,pendingIds:S,cachedIds:T,matches:E,pendingMatches:z,cachedMatches:$,firstId:P,hasPending:L,matchRouteDeps:W,matchStores:l,pendingMatchStores:c,cachedMatchStores:u,__store:F,getRouteMatchStore:I,setMatches:M,setPending:Y,setCached:ae};M(e.matches),a?.(D);function M(H){_p(H,l,w,s,i)}function Y(H){_p(H,c,S,s,i)}function ae(H){_p(H,u,T,s,i)}return D}function Op(e,n){const s=[];for(const r of n){const i=e.get(r);i&&s.push(i.get())}return s}function _p(e,n,s,r,i){const a=e.map(c=>c.id),l=new Set(a);i(()=>{for(const c of n.keys())l.has(c)||n.delete(c);for(const c of e){const u=n.get(c.id);if(!u){const h=r(c);h.routeId=c.routeId,n.set(c.id,h);continue}u.routeId=c.routeId,u.get()!==c&&u.set(c)}X8(s.get(),a)||s.set(a)})}const Bm=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},$7=e=>e.stores.matchesId.get().some(n=>e.stores.matchStores.get(n)?.get()._forcePending),lu=(e,n)=>!!(e.preload&&!e.router.stores.matchStores.has(n)),hi=(e,n,s=!0)=>{const r={...e.router.options.context??{}},i=s?n:n-1;for(let a=0;a<=i;a++){const l=e.matches[a];if(!l)continue;const c=e.router.getMatch(l.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},oj=(e,n)=>{if(!e.matches.length)return;const s=n.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=r>=0?r:0;let a=s?e.matches.findIndex(l=>l.routeId===s):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let l=a;l>=0;l--){const c=e.matches[l];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return l}return s?a:i},qr=(e,n,s)=>{if(!(!yn(s)&&!Zt(s)))throw yn(s)&&s.redirectHandled&&!s.options.reloadDocument||(n&&(n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.loaderPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,n._nonReactive.loaderPromise=void 0,n._nonReactive.error=s,e.updateMatch(n.id,r=>({...r,status:yn(s)?"redirected":Zt(s)?"notFound":r.status==="pending"?"success":r.status,context:hi(e,n.index),isFetching:!1,error:s})),Zt(s)&&!s.routeId&&(s.routeId=n.routeId),n._nonReactive.loadPromise?.resolve()),yn(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},vv=(e,n)=>{const s=e.router.getMatch(n);return!!(!s||s._nonReactive.dehydrated)},lj=(e,n,s)=>{const r=hi(e,s);e.updateMatch(n,i=>({...i,context:r}))},$o=(e,n,s,r)=>{const{id:i,routeId:a}=e.matches[n],l=e.router.looseRoutesById[a];if(s instanceof Promise)throw s;s.routerCode=r,e.firstBadMatchIndex??=n,qr(e,e.router.getMatch(i),s);try{l.options.onError?.(s)}catch(c){s=c,qr(e,e.router.getMatch(i),s)}e.updateMatch(i,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!yn(s)&&!Zt(s)&&(e.serialError??=s)},bv=(e,n,s,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!lu(e,n)&&(s.options.loader||s.options.beforeLoad||Nv(s))&&typeof i=="number"&&i!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{Bm(e)},i);r._nonReactive.pendingTimeout=a}},T7=(e,n,s)=>{const r=e.router.getMatch(n);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;bv(e,n,s,r);const i=()=>{const a=e.router.getMatch(n);a.preload&&(a.status==="redirected"||a.status==="notFound")&&qr(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},E7=(e,n,s,r)=>{const i=e.router.getMatch(n);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=fa(()=>{a?.resolve(),a=void 0});const{paramsError:l,searchError:c}=i;l&&$o(e,s,l,"PARSE_PARAMS"),c&&$o(e,s,c,"VALIDATE_SEARCH"),bv(e,n,r,i);const u=new AbortController;let h=!1;const m=()=>{h||(h=!0,e.updateMatch(n,E=>({...E,isFetching:"beforeLoad",fetchCount:E.fetchCount+1,abortController:u})))},p=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(n,E=>({...E,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{m(),p()});return}i._nonReactive.beforeLoadPromise=fa();const x={...hi(e,s,!1),...i.__routeContext},{search:g,params:j,cause:k}=i,b=lu(e,n),w={search:g,abortController:u,params:j,preload:b,context:x,location:e.location,navigate:E=>e.router.navigate({...E,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:b?"preload":k,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},S=E=>{if(E===void 0){e.router.batch(()=>{m(),p()});return}(yn(E)||Zt(E))&&(m(),$o(e,s,E,"BEFORE_LOAD")),e.router.batch(()=>{m(),e.updateMatch(n,z=>({...z,__beforeLoadContext:E})),p()})};let T;try{if(T=r.options.beforeLoad(w),Go(T))return m(),T.catch(E=>{$o(e,s,E,"BEFORE_LOAD")}).then(S)}catch(E){m(),$o(e,s,E,"BEFORE_LOAD")}S(T)},A7=(e,n)=>{const{id:s,routeId:r}=e.matches[n],i=e.router.looseRoutesById[r],a=()=>c(),l=()=>E7(e,s,n,i),c=()=>{if(vv(e,s))return;const u=T7(e,s,i);return Go(u)?u.then(l):l()};return a()},P7=(e,n,s)=>{const r=e.router.getMatch(n);if(!r||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([s.options.head?.(i),s.options.scripts?.(i),s.options.headers?.(i)]).then(([a,l,c])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:c,scripts:l,styles:a?.styles}))},wv=(e,n,s,r,i)=>{const a=n[r-1],{params:l,loaderDeps:c,abortController:u,cause:h}=e.router.getMatch(s),m=hi(e,r),p=lu(e,s);return{params:l,deps:c,preload:!!p,parentMatchPromise:a,abortController:u,context:m,location:e.location,navigate:x=>e.router.navigate({...x,_fromLocation:e.location}),cause:p?"preload":h,route:i,...e.router.options.additionalContext}},cj=async(e,n,s,r,i)=>{try{const a=e.router.getMatch(s);try{(!(uv??e.router.isServer)||a.ssr===!0)&&Zo(i);const l=i.options.loader,c=typeof l=="function"?l:l?.handler,u=c?.(wv(e,n,s,r,i)),h=!!c&&Go(u);if((h||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(s,p=>({...p,isFetching:"loader"})),c){const p=h?await u:u;qr(e,e.router.getMatch(s),p),p!==void 0&&e.updateMatch(s,x=>({...x,loaderData:p}))}i._lazyPromise&&await i._lazyPromise;const m=a._nonReactive.minPendingPromise;m&&await m,i._componentsPromise&&await i._componentsPromise,e.updateMatch(s,p=>({...p,error:void 0,context:hi(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let c=l;if(c?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(s,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:hi(e,r)}));return}const u=a._nonReactive.minPendingPromise;u&&await u,Zt(l)&&await i.options.notFoundComponent?.preload?.(),qr(e,e.router.getMatch(s),l);try{i.options.onError?.(l)}catch(h){c=h,qr(e,e.router.getMatch(s),h)}!yn(c)&&!Zt(c)&&await Zo(i,["errorComponent"]),e.updateMatch(s,h=>({...h,error:c,context:hi(e,r),status:"error",isFetching:!1}))}}catch(a){const l=e.router.getMatch(s);l&&(l._nonReactive.loaderPromise=void 0),qr(e,l,a)}},R7=async(e,n,s)=>{async function r(g,j,k,b,w){const S=Date.now()-j.updatedAt,T=g?w.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:w.options.staleTime??e.router.options.defaultStaleTime??0,E=w.options.shouldReload,z=typeof E=="function"?E(wv(e,n,i,s,w)):E,{status:$,invalid:P}=b,L=S>=T&&(!!e.forceStaleReload||b.cause==="enter"||k!==void 0&&k!==b.id);l=$==="success"&&(P||(z??L)),g&&w.options.preload===!1||(l&&!e.sync&&m?(c=!0,(async()=>{try{await cj(e,n,i,s,w);const W=e.router.getMatch(i);W._nonReactive.loaderPromise?.resolve(),W._nonReactive.loadPromise?.resolve(),W._nonReactive.loaderPromise=void 0,W._nonReactive.loadPromise=void 0}catch(W){yn(W)&&await e.router.navigate(W.options)}})()):$!=="success"||l?await cj(e,n,i,s,w):lj(e,i,s))}const{id:i,routeId:a}=e.matches[s];let l=!1,c=!1;const u=e.router.looseRoutesById[a],h=u.options.loader,m=((typeof h=="function"?void 0:h?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(vv(e,i)){if(!e.router.getMatch(i))return e.matches[s];lj(e,i,s)}else{const g=e.router.getMatch(i),j=e.router.stores.matchesId.get()[s],k=(j&&e.router.stores.matchStores.get(j)||null)?.routeId===a?j:e.router.stores.matches.get().find(w=>w.routeId===a)?.id,b=lu(e,i);if(g._nonReactive.loaderPromise){if(g.status==="success"&&!e.sync&&!g.preload&&m)return g;await g._nonReactive.loaderPromise;const w=e.router.getMatch(i),S=w._nonReactive.error||w.error;S&&qr(e,w,S),w.status==="pending"&&await r(b,g,k,w,u)}else{const w=b&&!e.router.stores.matchStores.has(i),S=e.router.getMatch(i);S._nonReactive.loaderPromise=fa(),w!==S.preload&&e.updateMatch(i,T=>({...T,preload:w})),await r(b,g,k,S,u)}}const p=e.router.getMatch(i);c||(p._nonReactive.loaderPromise?.resolve(),p._nonReactive.loadPromise?.resolve(),p._nonReactive.loadPromise=void 0),clearTimeout(p._nonReactive.pendingTimeout),p._nonReactive.pendingTimeout=void 0,c||(p._nonReactive.loaderPromise=void 0),p._nonReactive.dehydrated=void 0;const x=c?p.isFetching:!1;return x!==p.isFetching||p.invalid!==!1?(e.updateMatch(i,g=>({...g,isFetching:x,invalid:!1})),e.router.getMatch(i)):p};async function dj(e){const n=e,s=[];$7(n.router)&&Bm(n);let r;for(let x=0;x<n.matches.length;x++){try{const g=A7(n,x);Go(g)&&await g}catch(g){if(yn(g))throw g;if(Zt(g))r=g;else if(!n.preload)throw g;break}if(n.serialError||n.firstBadMatchIndex!=null)break}const i=n.firstBadMatchIndex??n.matches.length,a=r&&!n.preload?oj(n,r):void 0,l=r&&n.preload?0:a!==void 0?Math.min(a+1,i):i;let c,u;for(let x=0;x<l;x++)s.push(R7(n,s,x));try{await Promise.all(s)}catch{const x=await Promise.allSettled(s);for(const g of x){if(g.status!=="rejected")continue;const j=g.reason;if(yn(j))throw j;Zt(j)?c??=j:u??=j}if(u!==void 0)throw u}const h=c??(r&&!n.preload?r:void 0);let m=n.firstBadMatchIndex!==void 0?n.firstBadMatchIndex:n.matches.length-1;if(!h&&r&&n.preload)return n.matches;if(h){const x=oj(n,h);x===void 0&&Qs();const g=n.matches[x],j=n.router.looseRoutesById[g.routeId],k=n.router.options?.defaultNotFoundComponent;!j.options.notFoundComponent&&k&&(j.options.notFoundComponent=k),h.routeId=g.routeId;const b=g.routeId===n.router.routeTree.id;n.updateMatch(g.id,w=>({...w,...b?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:h},isFetching:!1})),m=x,await Zo(j,["notFoundComponent"])}else if(!n.preload){const x=n.matches[0];x.globalNotFound||n.router.getMatch(x.id)?.globalNotFound&&n.updateMatch(x.id,g=>({...g,globalNotFound:!1,error:void 0}))}if(n.serialError&&n.firstBadMatchIndex!==void 0){const x=n.router.looseRoutesById[n.matches[n.firstBadMatchIndex].routeId];await Zo(x,["errorComponent"])}for(let x=0;x<=m;x++){const{id:g,routeId:j}=n.matches[x],k=n.router.looseRoutesById[j];try{const b=P7(n,g,k);if(b){const w=await b;n.updateMatch(g,S=>({...S,...w}))}}catch(b){console.error(`Error executing head for route ${j}:`,b)}}const p=Bm(n);if(Go(p)&&await p,h)throw h;if(n.serialError&&!n.preload&&!n.onReady)throw n.serialError;return n.matches}function uj(e,n){const s=n.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function Zo(e,n=hd){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...a}=r.options;Object.assign(e.options,a),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const s=()=>e._componentsLoaded?void 0:n===hd?(()=>{if(e._componentsPromise===void 0){const r=uj(e,hd);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():uj(e,n);return e._lazyPromise?e._lazyPromise.then(s):s()}function Nv(e){for(const n of hd)if(e.options[n]?.preload)return!0;return!1}const hd=["component","errorComponent","pendingComponent","notFoundComponent"];var Fr="__TSR_index",hj="popstate",pj="beforeunload";function q7(e){let n=e.getLocation();const s=new Set,r=l=>{n=e.getLocation(),s.forEach(c=>c({location:n,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):n=e.getLocation()},a=async({task:l,navigateOpts:c,...u})=>{if(c?.ignoreBlocker??!1){l();return}const h=e.getBlockers?.()??[],m=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&h.length&&m)for(const p of h){const x=Nd(u.path,u.state);if(await p.blockerFn({currentLocation:n,nextLocation:x,action:u.type})){e.onBlocked?.();return}}l()};return{get location(){return n},get length(){return e.getLength()},subscribers:s,subscribe:l=>(s.add(l),()=>{s.delete(l)}),push:(l,c,u)=>{const h=n.state[Fr];c=mj(h+1,c),a({task:()=>{e.pushState(l,c),r({type:"PUSH"})},navigateOpts:u,type:"PUSH",path:l,state:c})},replace:(l,c,u)=>{const h=n.state[Fr];c=mj(h,c),a({task:()=>{e.replaceState(l,c),r({type:"REPLACE"})},navigateOpts:u,type:"REPLACE",path:l,state:c})},go:(l,c)=>{a({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:c,type:"GO"})},back:l=>{a({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{a({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>n.state[Fr]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,l]),()=>{const u=e.getBlockers?.()??[];e.setBlockers?.(u.filter(h=>h!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function mj(e,n){n||(n={});const s=e1();return{...n,key:s,__TSR_key:s,[Fr]:e}}function I7(e){const n=typeof document<"u"?window:void 0,s=n.history.pushState,r=n.history.replaceState;let i=[];const a=()=>i,l=L=>i=L,c=(L=>L),u=(()=>Nd(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!n.history.state?.__TSR_key&&!n.history.state?.key){const L=e1();n.history.replaceState({[Fr]:0,key:L,__TSR_key:L},"")}let h=u(),m,p=!1,x=!1,g=!1,j=!1;const k=()=>h;let b,w;const S=()=>{b&&(P._ignoreSubscribers=!0,(b.isPush?n.history.pushState:n.history.replaceState)(b.state,"",b.href),P._ignoreSubscribers=!1,b=void 0,w=void 0,m=void 0)},T=(L,W,F)=>{const U=c(W);w||(m=h),h=Nd(W,F),b={href:U,state:F,isPush:b?.isPush||L==="push"},w||(w=Promise.resolve().then(()=>S()))},E=L=>{h=u(),P.notify({type:L})},z=async()=>{if(x){x=!1;return}const L=u(),W=L.state[Fr]-h.state[Fr],F=W===1,U=W===-1,I=!F&&!U||p;p=!1;const D=I?"GO":U?"BACK":"FORWARD",M=I?{type:"GO",index:W}:{type:U?"BACK":"FORWARD"};if(g)g=!1;else{const Y=a();if(typeof document<"u"&&Y.length){for(const ae of Y)if(await ae.blockerFn({currentLocation:h,nextLocation:L,action:D})){x=!0,n.history.go(1),P.notify(M);return}}}h=u(),P.notify(M)},$=L=>{if(j){j=!1;return}let W=!1;const F=a();if(typeof document<"u"&&F.length)for(const U of F){const I=U.enableBeforeUnload??!0;if(I===!0){W=!0;break}if(typeof I=="function"&&I()===!0){W=!0;break}}if(W)return L.preventDefault(),L.returnValue=""},P=q7({getLocation:k,getLength:()=>n.history.length,pushState:(L,W)=>T("push",L,W),replaceState:(L,W)=>T("replace",L,W),back:L=>(L&&(g=!0),j=!0,n.history.back()),forward:L=>{L&&(g=!0),j=!0,n.history.forward()},go:L=>{p=!0,n.history.go(L)},createHref:L=>c(L),flush:S,destroy:()=>{n.history.pushState=s,n.history.replaceState=r,n.removeEventListener(pj,$,{capture:!0}),n.removeEventListener(hj,z)},onBlocked:()=>{m&&h!==m&&(h=m)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return n.addEventListener(pj,$,{capture:!0}),n.addEventListener(hj,z),n.history.pushState=function(...L){const W=s.apply(n.history,L);return P._ignoreSubscribers||E("PUSH"),W},n.history.replaceState=function(...L){const W=r.apply(n.history,L);return P._ignoreSubscribers||E("REPLACE"),W},P}function F7(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Nd(e,n){const s=F7(e),r=s.indexOf("#"),i=s.indexOf("?"),a=e1();return{href:s,pathname:s.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:s.length),hash:r>-1?s.substring(r):"",search:i>-1?s.slice(i,r===-1?void 0:r):"",state:n||{[Fr]:0,key:a,__TSR_key:a}}}function e1(){return(Math.random()+1).toString(36).substring(7)}function ca(e,n){const s=n,r=e;return{fromLocation:s,toLocation:r,pathChanged:s?.pathname!==r.pathname,hrefChanged:s?.href!==r.href,hashChanged:s?.hash!==r.hash}}var L7=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.routeBranchCache=new WeakMap,this.startTransition=s=>s(),this.update=s=>{const r=this.options,i=this.basepath??r?.basepath??"/",a=this.basepath===void 0,l=r?.rewrite;if(this.options={...r,...s},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=u7(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=I7()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let m;this.resolvePathCache=Qo(1e3),m=this.buildRouteTree(),this.setRoutes(m)}if(!this.stores&&this.latestLocation){const m=this.getStoreConfig(this);this.batch=m.batch,this.stores=C7(M7(this.latestLocation),m),x7(this)}let c=!1;const u=this.options.basepath??"/",h=this.options.rewrite;if(a||i!==u||l!==h){this.basepath=u;const m=[],p=jv(u);p&&p!=="/"&&m.push(S7({basepath:u})),h&&m.push(h),this.rewrite=m.length===0?void 0:m.length===1?m[0]:N7(m),this.history&&this.updateLatestLocation(),c=!0}c&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const s=i7(this.routeTree,this.options.caseSensitive,(r,i)=>{r.init({originalIndex:i})});return this.options.routeMasks&&e7(this.options.routeMasks,s.processedTree),s},this.subscribe=(s,r)=>{const i={eventType:s,fn:r};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=s=>{this.subscribers.forEach(r=>{r.eventType===s.type&&r.fn(s)})},this.parseLocation=(s,r)=>{const i=({pathname:u,search:h,hash:m,href:p,state:x})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){const w=this.options.parseSearch(h),S=this.options.stringifySearch(w);return{href:u+S+m,publicHref:u+S+m,pathname:So(u).path,external:!1,searchStr:S,search:ri(r?.search,w),hash:So(m.slice(1)).path,state:Pr(r?.state,x)}}const g=new URL(p,this.origin),j=Dm(this.rewrite,g),k=this.options.parseSearch(j.search),b=this.options.stringifySearch(k);return j.search=b,{href:j.href.replace(j.origin,""),publicHref:p,pathname:So(j.pathname).path,external:!!this.rewrite&&j.origin!==this.origin,searchStr:b,search:ri(r?.search,k),hash:So(j.hash.slice(1)).path,state:Pr(r?.state,x)}},a=i(s),{__tempLocation:l,__tempKey:c}=a.state;if(l&&(!c||c===this.tempLocationKey)){const u=i(l);return u.state.key=a.state.key,u.state.__TSR_key=a.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:a}}return a},this.resolvePathWithBase=(s,r)=>d7({base:s,to:r.includes("//")?Jf(r):r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(s,r,i)=>typeof s=="string"?this.matchRoutesInternal({pathname:s,search:r},i):this.matchRoutesInternal(s,r),this.getMatchedRoutes=s=>O7({pathname:s,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=s=>{const r=this.getMatch(s);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(s=>{this.cancelMatch(s)}),this.stores.matchesId.get().forEach(s=>{if(this.stores.pendingMatchStores.has(s))return;const r=this.stores.matchStores.get(s)?.get();r&&(r.status==="pending"||r.isFetching==="loader")&&this.cancelMatch(s)})},this.buildLocation=s=>{const r=(a={})=>{const l=a._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutesLightweight(l);a.from;const u=a.unsafeRelative==="path"?l.pathname:a.from??c.fullPath,h=a.to?`${a.to}`:void 0,m=c.search,p=Object.assign(Object.create(null),c.params),x=h?.charCodeAt(0)===47?"/":this.resolvePathWithBase(u,"."),g=h?this.resolvePathWithBase(x,h):x,j=a.params===!1||a.params===null?Object.create(null):(a.params??!0)===!0?p:Object.assign(p,Ar(a.params,p)),k=this.routesByPath[Gs(g)];let b;if(k)b=this.getRouteBranch(k);else if(g.includes("$"))b=[];else{const U=this.getMatchedRoutes(g);b=U.matchedRoutes,this.options.notFoundRoute&&(!U.foundRoute||U.foundRoute.path!=="/"&&U.routeParams["**"])&&(b=[...b,this.options.notFoundRoute])}if(b.length&&pv(j))for(const U of b){const I=U.options.params?.stringify??U.options.stringifyParams;if(I)try{Object.assign(j,I(j))}catch{}}const w=s.leaveParams?g:So(sj({path:g,params:j,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let S=m;if(s._includeValidateSearch&&this.options.search?.strict){const U={};b.forEach(I=>{if(I.options.validateSearch)try{Object.assign(U,pd(I.options.validateSearch,{...U,...S}))}catch{}}),S=U}S=_7({search:S,dest:a,destRoutes:b,_includeValidateSearch:s._includeValidateSearch}),S=ri(m,S);const T=this.options.stringifySearch(S),E=a.hash===!0?l.hash:a.hash?Ar(a.hash,l.hash):void 0,z=E?`#${E}`:"";let $=a.state===!0?l.state:a.state?Ar(a.state,l.state):{};$=Pr(l.state,$);const P=`${w}${T}${z}`;let L,W,F=!1;if(this.rewrite){const U=new URL(P,this.origin),I=kv(this.rewrite,U);L=U.href.replace(U.origin,""),I.origin!==this.origin?(W=I.href,F=!0):W=I.pathname+I.search+I.hash}else L=Z8(P),W=L;return{publicHref:W,href:L,pathname:w,search:S,searchStr:T,state:$,hash:E??"",external:F,unmaskOnReload:a.unmaskOnReload}},i=(a={},l)=>{const c=r(a);let u=l?r(l):void 0;if(!u){const h=Object.create(null);if(this.options.routeMasks){const m=t7(c.pathname,this.processedTree);if(m){Object.assign(h,m.rawParams);const{from:p,params:x,...g}=m.route,j=x===!1||x===null?Object.create(null):(x??!0)===!0?h:Object.assign(h,Ar(x,h));l={from:s.from,...g,params:j},u=r(l)}}}return u&&(c.maskedLocation=u),c};return s.mask?i(s,{from:s.from,...s.mask}):i(s)},this.commitLocation=async({viewTransition:s,ignoreBlocker:r,...i})=>{const a=()=>{const u=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];u.forEach(m=>{i.state[m]=this.latestLocation.state[m]});const h=di(i.state,this.latestLocation.state);return u.forEach(m=>{delete i.state[m]}),h},l=Gs(this.latestLocation.href)===Gs(i.href);let c=this.commitLocationPromise;if(this.commitLocationPromise=fa(()=>{c?.resolve(),c=void 0}),l&&a())this.load();else{let{maskedLocation:u,hashScrollIntoView:h,...m}=i;u&&(m={...u,state:{...u.state,__tempKey:void 0,__tempLocation:{...m,search:m.searchStr,state:{...m.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(m.unmaskOnReload??this.options.unmaskOnReload??!1)&&(m.state.__tempKey=this.tempLocationKey)),m.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=s,this.history[i.replace?"replace":"push"](m.publicHref,m.state,{ignoreBlocker:r})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:s,resetScroll:r,hashScrollIntoView:i,viewTransition:a,ignoreBlocker:l,href:c,...u}={})=>{if(c){const p=this.history.location.state.__TSR_index,x=Nd(c,{__TSR_index:s?p:p+1}),g=new URL(x.pathname,this.origin);u.to=Dm(this.rewrite,g).pathname,u.search=this.options.parseSearch(x.search),u.hash=x.hash.slice(1)}const h=this.buildLocation({...u,_includeValidateSearch:!0});this.pendingBuiltLocation=h;const m=this.commitLocation({...h,viewTransition:a,replace:s,resetScroll:r,hashScrollIntoView:i,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===h&&(this.pendingBuiltLocation=void 0)}),m},this.navigate=async({to:s,reloadDocument:r,href:i,publicHref:a,...l})=>{let c=!1;if(i)try{new URL(`${i}`),c=!0}catch{}if(c&&!r&&(r=!0),r){if(s!==void 0||!i){const h=this.buildLocation({to:s,...l});i=i??h.publicHref,a=a??h.publicHref}const u=!c&&a?a:i;if(bd(u,this.protocolAllowlist))return Promise.resolve();if(!l.ignoreBlocker){const h=this.history.getBlockers?.()??[];for(const m of h)if(m?.blockerFn&&await m.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return l.replace?window.location.replace(u):window.location.href=u,Promise.resolve()}return this.buildAndCommitLocation({...l,href:i,to:s,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const s=this.matchRoutes(this.latestLocation),r=this.stores.cachedMatches.get().filter(i=>!s.some(a=>a.id===i.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(s),this.stores.setCached(r)})},this.load=async s=>{let r,i,a;const l=this.stores.resolvedLocation.get()??this.stores.location.get();for(a=new Promise(u=>{this.startTransition(async()=>{try{this.beforeLoad();const h=this.latestLocation,m=ca(h,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...m}),this.emit({type:"onBeforeLoad",...m}),await dj({router:this,sync:s?.sync,forceStaleReload:l.href===h.href,matches:this.stores.pendingMatches.get(),location:h,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=null,x=null,g=null,j=null;this.batch(()=>{const k=this.stores.pendingMatches.get(),b=k.length,w=this.stores.matches.get();p=b?w.filter(E=>!this.stores.pendingMatchStores.has(E.id)):null;const S=new Set;for(const E of this.stores.pendingMatchStores.values())E.routeId&&S.add(E.routeId);const T=new Set;for(const E of this.stores.matchStores.values())E.routeId&&T.add(E.routeId);x=b?w.filter(E=>!S.has(E.routeId)):null,g=b?k.filter(E=>!T.has(E.routeId)):null,j=b?k.filter(E=>T.has(E.routeId)):w,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),b&&(this.stores.setMatches(k),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...p.filter(E=>E.status!=="error"&&E.status!=="notFound"&&E.status!=="redirected")]),this.clearExpiredCache())});for(const[k,b]of[[x,"onLeave"],[g,"onEnter"],[j,"onStay"]])if(k)for(const w of k)this.looseRoutesById[w.routeId].options[b]?.(w)})})}})}catch(h){yn(h)?(r=h,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):Zt(h)&&(i=h);const m=r?r.status:i?404:this.stores.matches.get().some(p=>p.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(m),this.stores.redirect.set(r)})}this.latestLoadPromise===a&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=a,await a;this.latestLoadPromise&&a!==this.latestLoadPromise;)await this.latestLoadPromise;let c;this.hasNotFoundMatch()?c=404:this.stores.matches.get().some(u=>u.status==="error")&&(c=500),c!==void 0&&this.stores.statusCode.set(c)},this.startViewTransition=s=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const a=this.latestLocation,l=this.stores.resolvedLocation.get(),c=typeof r.types=="function"?r.types(ca(a,l)):r.types;if(c===!1){s();return}i={update:s,types:c}}else i=s;document.startViewTransition(i)}else s()},this.updateMatch=(s,r)=>{this.startTransition(()=>{const i=this.stores.pendingMatchStores.get(s);if(i){i.set(r);return}const a=this.stores.matchStores.get(s);if(a){a.set(r);return}const l=this.stores.cachedMatchStores.get(s);if(l){const c=r(l.get());c.status==="redirected"?this.stores.cachedMatchStores.delete(s)&&this.stores.cachedIds.set(u=>u.filter(h=>h!==s)):l.set(c)}})},this.getMatch=s=>this.stores.cachedMatchStores.get(s)?.get()??this.stores.pendingMatchStores.get(s)?.get()??this.stores.matchStores.get(s)?.get(),this.invalidate=s=>{const r=i=>s?.filter?.(i)??!0?{...i,invalid:!0,...s?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(r)),this.stores.setCached(this.stores.cachedMatches.get().map(r)),this.stores.setPending(this.stores.pendingMatches.get().map(r))}),this.shouldViewTransition=!1,this.load({sync:s?.sync})},this.getParsedLocationHref=s=>s.publicHref||"/",this.resolveRedirect=s=>{const r=s.headers.get("Location");if(!s.options.href||s.options._builtLocation){const i=s.options._builtLocation??this.buildLocation(s.options),a=this.getParsedLocationHref(i);s.options.href=a,s.headers.set("Location",a)}else if(r)try{const i=new URL(r);if(this.origin&&i.origin===this.origin){const a=i.pathname+i.search+i.hash;s.options.href=a,s.headers.set("Location",a)}}catch{}if(s.options.href&&!s.options._builtLocation&&bd(s.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return s.headers.get("Location")||s.headers.set("Location",s.options.href),s},this.clearCache=s=>{const r=s?.filter;r!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(i=>!r(i))):this.stores.setCached([])},this.clearExpiredCache=()=>{const s=Date.now(),r=i=>{const a=this.looseRoutesById[i.routeId];if(!a.options.loader)return!0;const l=(i.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:s-i.updatedAt>=l};this.clearCache({filter:r})},this.loadRouteChunk=Zo,this.preloadRoute=async s=>{const r=s._builtLocation??this.buildLocation(s);let i=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:s});const a=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),l=new Set([...a,...this.stores.cachedIds.get()]),c=i.filter(u=>!l.has(u.id));if(c.length){const u=this.stores.cachedMatches.get();this.stores.setCached([...u,...c])}try{return i=await dj({router:this,matches:i,location:r,preload:!0,updateMatch:(u,h)=>{a.has(u)?i=i.map(m=>m.id===u?h(m):m):this.updateMatch(u,h)}}),i}catch(u){if(yn(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:r});Zt(u)||console.error(u);return}},this.matchRoute=(s,r)=>{const i={...s,to:s.to?this.resolvePathWithBase(s.from||"",s.to):void 0,params:s.params||{},leaveParams:!0},a=this.buildLocation(i);if(r?.pending&&this.stores.status.get()!=="pending")return!1;const l=(r?.pending===void 0?!this.stores.isLoading.get():r.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=n7(a.pathname,r?.caseSensitive??!1,r?.fuzzy??!1,l.pathname,this.processedTree);return!c||s.params&&!di(c.rawParams,s.params,{partial:!0})?!1:r?.includeSearch??!0?di(l.search,a.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(s=>s.status==="notFound"||s.globalNotFound),this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??v7,parseSearch:e.parseSearch??k7,protocolAllowlist:e.protocolAllowlist??Q8}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:s}){this.routesById=e,this.routesByPath=n,this.processedTree=s;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=xv(e),this.routeBranchCache.set(e,n)),n}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,n){const s=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=s;let{matchedRoutes:a}=s,l=!1;(r?r.path!=="/"&&i["**"]:Gs(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:l=!0);const c=l?B7(this.options.notFoundMode,a):void 0,u=new Array(a.length),h=new Map;for(const m of this.stores.matchStores.values())m.routeId&&h.set(m.routeId,m.get());for(let m=0;m<a.length;m++){const p=a[m],x=u[m-1];let g,j,k;{const I=x?.search??e.search,D=x?._strictSearch??void 0;try{const M=pd(p.options.validateSearch,{...I})??void 0;g={...I,...M},j={...D,...M},k=void 0}catch(M){let Y=M;if(M instanceof Sd||(Y=new Sd(M.message,{cause:M})),n?.throwOnError)throw Y;g=I,j={},k=Y}}const b=p.options.loaderDeps?.({search:g})??"",w=b?JSON.stringify(b):"",{interpolatedPath:S,usedParams:T}=sj({path:p.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),E=p.id+S+w,z=this.getMatch(E),$=h.get(p.id),P=z?._strictParams??T;let L;if(!z)try{fj(p,P)}catch(I){if(Zt(I)||yn(I)?L=I:L=new z7(I.message,{cause:I}),n?.throwOnError)throw L}Object.assign(i,P);const W=$?"stay":"enter";let F;if(z)F={...z,cause:W,params:$?.params??i,_strictParams:P,search:ri($?$.search:z.search,g),_strictSearch:j};else{const I=p.options.loader||p.options.beforeLoad||p.lazyFn||Nv(p)?"pending":"success";F={id:E,ssr:p.options.ssr,index:m,routeId:p.id,params:$?.params??i,_strictParams:P,pathname:S,updatedAt:Date.now(),search:$?ri($.search,g):g,_strictSearch:j,searchError:void 0,status:I,isFetching:!1,error:void 0,paramsError:L,__routeContext:void 0,_nonReactive:{loadPromise:fa()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:W,loaderDeps:$?Pr($.loaderDeps,b):b,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:p.options.staticData||{},fullPath:p.fullPath}}n?.preload||(F.globalNotFound=c===p.id),F.searchError=k;const U=this.getParentContext(x);F.context={...U,...F.__routeContext,...F.__beforeLoadContext},u[m]=F}for(let m=0;m<u.length;m++){const p=u[m],x=this.looseRoutesById[p.routeId],g=this.getMatch(p.id),j=h.get(p.routeId);if(p.params=j?ri(j.params,i):i,!g){const k=u[m-1],b=this.getParentContext(k);if(x.options.context){const w={deps:p.loaderDeps,params:p.params,context:b??{},location:e,navigate:S=>this.navigate({...S,_fromLocation:e}),buildLocation:this.buildLocation,cause:p.cause,abortController:p.abortController,preload:!!p.preload,matches:u,routeId:x.id};p.__routeContext=x.options.context(w)??void 0}p.context={...b,...p.__routeContext,...p.__beforeLoadContext}}}return u}matchRoutesLightweight(e){const{matchedRoutes:n,routeParams:s}=this.getMatchedRoutes(e.pathname),r=Yo(n),i={...e.search};for(const h of n)try{Object.assign(i,pd(h.options.validateSearch,i))}catch{}const a=Yo(this.stores.matchesId.get()),l=a&&this.stores.matchStores.get(a)?.get(),c=l&&l.routeId===r.id&&l.pathname===e.pathname;let u;if(c)u=l.params;else{const h=Object.assign(Object.create(null),s);for(const m of n)try{fj(m,h)}catch{}u=h}return{matchedRoutes:n,fullPath:r.fullPath,search:i,params:u}}},Sd=class extends Error{},z7=class extends Error{};function M7(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function pd(e,n){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(n);if(s instanceof Promise)throw new Sd("Async validation not supported");if(s.issues)throw new Sd(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in e?e.parse(n):typeof e=="function"?e(n):{}}function O7({pathname:e,routesById:n,processedTree:s}){const r=Object.create(null),i=Gs(e);let a;const l=s7(i,s,!0);return l&&(a=l.route,Object.assign(r,l.rawParams)),{matchedRoutes:l?.branch||[n.__root__],routeParams:r,foundRoute:a}}function _7({search:e,dest:n,destRoutes:s,_includeValidateSearch:r}){return D7(s)(e,n,r??!1)}function D7(e){const n={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&n.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const a=({search:l,next:c})=>{let u=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(u=i.options.preSearchFilters.reduce((m,p)=>p(m),l));const h=c(u);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((m,p)=>p(m),h):h};n.middlewares.push(a)}if(i.options.validateSearch){const a=({search:l,next:c})=>{const u=c(l);if(!n._includeValidateSearch)return u;try{return{...u,...pd(i.options.validateSearch,u)??void 0}}catch{return u}};n.middlewares.push(a)}}const s=({search:i})=>{const a=n.dest;return a.search?a.search===!0?i:Ar(a.search,i):{}};n.middlewares.push(s);const r=(i,a,l)=>{if(i>=l.length)return a;const c=l[i];return c({search:a,next:h=>r(i+1,h,l)})};return function(a,l,c){return n.dest=l,n._includeValidateSearch=c,r(0,a,n.middlewares)}}function B7(e,n){if(e!=="root")for(let s=n.length-1;s>=0;s--){const r=n[s];if(r.children)return r.id}return ui}function fj(e,n){const s=e.options.params?.parse??e.options.parseParams;if(s){const r=s(n);if(r===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(n,r)}}const W7="Error preloading route! ☝️";var Sv=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{this.originalIndex=n.originalIndex;const s=this.options,r=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=ui:this.parentRoute||Qs();let i=r?ui:s?.path;i&&i!=="/"&&(i=yv(i));const a=s?.id||i;let l=r?ui:ud([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=ud(["/",l]));const c=l==="__root__"?"/":ud([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=c,this._to=Gs(c)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>jl({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},U7=class extends Sv{constructor(e){super(e)}};function H7(e){if(typeof document<"u"&&document.querySelector){const n=e.stores.location.get(),s=n.state.__hashScrollIntoViewOptions??!0;if(s&&n.hash!==""){const r=document.getElementById(n.hash);r&&r.scrollIntoView(s)}}}function t1(e){const n=e.errorComponent??n1;return t.jsx(K7,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:r})=>s?N.createElement(n,{error:s,reset:r}):e.children})}var K7=class extends N.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,n){const s=e.getResetKey();return n.error&&n.resetKey!==s?{resetKey:s,error:null}:{resetKey:s}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,n){this.props.onCatch&&this.props.onCatch(e,n)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function n1({error:e}){const[n,s]=N.useState(!1);return t.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[t.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),t.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(r=>!r),children:n?"Hide Error":"Show Error"})]}),t.jsx("div",{style:{height:".25rem"}}),n?t.jsx("div",{children:t.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?t.jsx("code",{children:e.message}):null})}):null]})}function V7({children:e,fallback:n=null}){return Cv()?t.jsx(Uo.Fragment,{children:e}):t.jsx(Uo.Fragment,{children:n})}function Cv(){return Uo.useSyncExternalStore(Y7,()=>!0,()=>!1)}function Y7(){return()=>{}}var $v=N.createContext(null);function vn(e){return N.useContext($v)}var cu=N.createContext(void 0),G7=N.createContext(void 0),ht=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(ht||{});function Q7({update:e,notify:n,unwatched:s}){return{link:r,unlink:i,propagate:a,checkDirty:l,shallowPropagate:c};function r(h,m,p){const x=m.depsTail;if(x!==void 0&&x.dep===h)return;const g=x!==void 0?x.nextDep:m.deps;if(g!==void 0&&g.dep===h){g.version=p,m.depsTail=g;return}const j=h.subsTail;if(j!==void 0&&j.version===p&&j.sub===m)return;const k=m.depsTail=h.subsTail={version:p,dep:h,sub:m,prevDep:x,nextDep:g,prevSub:j,nextSub:void 0};g!==void 0&&(g.prevDep=k),x!==void 0?x.nextDep=k:m.deps=k,j!==void 0?j.nextSub=k:h.subs=k}function i(h,m=h.sub){const p=h.dep,x=h.prevDep,g=h.nextDep,j=h.nextSub,k=h.prevSub;return g!==void 0?g.prevDep=x:m.depsTail=x,x!==void 0?x.nextDep=g:m.deps=g,j!==void 0?j.prevSub=k:p.subsTail=k,k!==void 0?k.nextSub=j:(p.subs=j)===void 0&&s(p),g}function a(h){let m=h.nextSub,p;e:do{const x=h.sub;let g=x.flags;if(g&60?g&12?g&4?!(g&48)&&u(h,x)?(x.flags=g|40,g&=1):g=0:x.flags=g&-9|32:g=0:x.flags=g|32,g&2&&n(x),g&1){const j=x.subs;if(j!==void 0){const k=(h=j).nextSub;k!==void 0&&(p={value:m,prev:p},m=k);continue}}if((h=m)!==void 0){m=h.nextSub;continue}for(;p!==void 0;)if(h=p.value,p=p.prev,h!==void 0){m=h.nextSub;continue e}break}while(!0)}function l(h,m){let p,x=0,g=!1;e:do{const j=h.dep,k=j.flags;if(m.flags&16)g=!0;else if((k&17)===17){if(e(j)){const b=j.subs;b.nextSub!==void 0&&c(b),g=!0}}else if((k&33)===33){(h.nextSub!==void 0||h.prevSub!==void 0)&&(p={value:h,prev:p}),h=j.deps,m=j,++x;continue}if(!g){const b=h.nextDep;if(b!==void 0){h=b;continue}}for(;x--;){const b=m.subs,w=b.nextSub!==void 0;if(w?(h=p.value,p=p.prev):h=b,g){if(e(m)){w&&c(b),m=h.sub;continue}g=!1}else m.flags&=-33;m=h.sub;const S=h.nextDep;if(S!==void 0){h=S;continue e}}return g}while(!0)}function c(h){do{const m=h.sub,p=m.flags;(p&48)===32&&(m.flags=p|16,(p&6)===2&&n(m))}while((h=h.nextSub)!==void 0)}function u(h,m){let p=m.depsTail;for(;p!==void 0;){if(p===h)return!0;p=p.prevDep}return!1}}function Z7(e,n,s){const r=typeof e=="object",i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:n)?.bind(i),complete:(r?e.complete:s)?.bind(i)}}const Wm=[];let md=0;const{link:gj,unlink:X7,propagate:J7,checkDirty:Tv,shallowPropagate:xj}=Q7({update(e){return e._update()},notify(e){Wm[Um++]=e,e.flags&=~ht.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=ht.Mutable|ht.Dirty,Cd(e))}});let Zc=0,Um=0,Es,Hm=0;function Ev(e){try{++Hm,e()}finally{--Hm||Av()}}function Cd(e){const n=e.depsTail;let s=n!==void 0?n.nextDep:e.deps;for(;s!==void 0;)s=X7(s,e)}function Av(){if(!(Hm>0)){for(;Zc<Um;){const e=Wm[Zc];Wm[Zc++]=void 0,e.notify()}Zc=0,Um=0}}function yj(e,n){const s=typeof e=="function",r=e,i={_snapshot:s?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?ht.None:ht.Mutable,get(){return Es!==void 0&&gj(i,Es,md),i._snapshot},subscribe(a){const l=Z7(a),c={current:!1},u=e9(()=>{i.get(),c.current?l.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{u.stop()}}},_update(a){const l=Es,c=n?.compare??Object.is;if(s)Es=i,++md,i.depsTail=void 0;else if(a===void 0)return!1;s&&(i.flags=ht.Mutable|ht.RecursedCheck);try{const u=i._snapshot,h=typeof a=="function"?a(u):a===void 0&&s?r(u):a;return u===void 0||!c(u,h)?(i._snapshot=h,!0):!1}finally{Es=l,s&&(i.flags&=~ht.RecursedCheck),Cd(i)}}};return s?(i.flags=ht.Mutable|ht.Dirty,i.get=function(){const a=i.flags;if(a&ht.Dirty||a&ht.Pending&&Tv(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&xj(l)}}else a&ht.Pending&&(i.flags=a&~ht.Pending);return Es!==void 0&&gj(i,Es,md),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(J7(l),xj(l),Av())}},i}function e9(e){const n=()=>{const r=Es;Es=s,++md,s.depsTail=void 0,s.flags=ht.Watching|ht.RecursedCheck;try{return e()}finally{Es=r,s.flags&=~ht.RecursedCheck,Cd(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:ht.Watching|ht.RecursedCheck,notify(){const r=this.flags;r&ht.Dirty||r&ht.Pending&&Tv(this.deps,this)?n():this.flags=ht.Watching},stop(){this.flags=ht.None,this.depsTail=void 0,Cd(this)}};return n(),s}var Dp={exports:{}},Bp={},Wp={exports:{}},Up={};/**
41
+ * @license React
42
+ * use-sync-external-store-shim.production.js
43
+ *
44
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE file in the root directory of this source tree.
48
+ */var jj;function t9(){if(jj)return Up;jj=1;var e=xl();function n(p,x){return p===x&&(p!==0||1/p===1/x)||p!==p&&x!==x}var s=typeof Object.is=="function"?Object.is:n,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function c(p,x){var g=x(),j=r({inst:{value:g,getSnapshot:x}}),k=j[0].inst,b=j[1];return a(function(){k.value=g,k.getSnapshot=x,u(k)&&b({inst:k})},[p,g,x]),i(function(){return u(k)&&b({inst:k}),p(function(){u(k)&&b({inst:k})})},[p]),l(g),g}function u(p){var x=p.getSnapshot;p=p.value;try{var g=x();return!s(p,g)}catch{return!0}}function h(p,x){return x()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return Up.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Up}var kj;function n9(){return kj||(kj=1,Wp.exports=t9()),Wp.exports}/**
49
+ * @license React
50
+ * use-sync-external-store-shim/with-selector.production.js
51
+ *
52
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE file in the root directory of this source tree.
56
+ */var vj;function s9(){if(vj)return Bp;vj=1;var e=xl(),n=n9();function s(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var r=typeof Object.is=="function"?Object.is:s,i=n.useSyncExternalStore,a=e.useRef,l=e.useEffect,c=e.useMemo,u=e.useDebugValue;return Bp.useSyncExternalStoreWithSelector=function(h,m,p,x,g){var j=a(null);if(j.current===null){var k={hasValue:!1,value:null};j.current=k}else k=j.current;j=c(function(){function w($){if(!S){if(S=!0,T=$,$=x($),g!==void 0&&k.hasValue){var P=k.value;if(g(P,$))return E=P}return E=$}if(P=E,r(T,$))return P;var L=x($);return g!==void 0&&g(P,L)?(T=$,P):(T=$,E=L)}var S=!1,T,E,z=p===void 0?null:p;return[function(){return w(m())},z===null?void 0:function(){return w(z())}]},[m,p,x,g]);var b=i(h,j[0],j[1]);return l(function(){k.hasValue=!0,k.value=b},[b]),u(b),b},Bp}var bj;function r9(){return bj||(bj=1,Dp.exports=s9()),Dp.exports}var i9=r9();function a9(e,n){return e===n}function jn(e,n,s=a9){const r=N.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(l);return c},[e]),i=N.useCallback(()=>e?.get(),[e]);return i9.useSyncExternalStoreWithSelector(r,i,i,n,s)}var o9={get:()=>{},subscribe:()=>({unsubscribe:()=>{}})};function bi(e){const n=vn(),s=N.useContext(e.from?G7:cu),r=e.from??s,i=r?e.from?n.stores.getRouteMatchStore(r):n.stores.matchStores.get(r):void 0,a=N.useRef(void 0);return jn(i??o9,l=>{if((e.shouldThrow??!0)&&!l&&Qs(),l===void 0)return;const c=e.select?e.select(l):l;if(e.structuralSharing??n.options.defaultStructuralSharing){const u=Pr(a.current,c);return a.current=u,u}return c})}function Pv(e){return bi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function Rv(e){const{select:n,...s}=e;return bi({...s,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function du(e){return bi({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const s=e.strict===!1?n.params:n._strictParams;return e.select?e.select(s):s}})}function _r(e){return bi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function _t(e){const n=vn();return N.useCallback(s=>n.navigate({...s,from:s.from??e?.from}),[e?.from,n])}function qv(e){return bi({...e,select:n=>e.select?e.select(n.context):n.context})}var kl=Gk();function l9(e,n){const s=vn(),r=K8(n),{activeProps:i,inactiveProps:a,activeOptions:l,to:c,preload:u,preloadDelay:h,preloadIntentProximity:m,hashScrollIntoView:p,replace:x,startTransition:g,resetScroll:j,viewTransition:k,children:b,target:w,disabled:S,style:T,className:E,onClick:z,onBlur:$,onFocus:P,onMouseEnter:L,onMouseLeave:W,onTouchStart:F,ignoreBlocker:U,params:I,search:D,hash:M,state:Y,mask:ae,reloadDocument:H,unsafeRelative:Z,from:ue,_fromLocation:q,...B}=e,ee=Cv(),O=N.useMemo(()=>e,[s,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ke=jn(s.stores.location,He=>He,(He,te)=>He.href===te.href),pe=N.useMemo(()=>{const He={_fromLocation:ke,...O};return s.buildLocation(He)},[s,ke,O]),xe=pe.maskedLocation?pe.maskedLocation.publicHref:pe.publicHref,Te=pe.maskedLocation?pe.maskedLocation.external:pe.external,Ee=N.useMemo(()=>m9(xe,Te,s.history,S),[S,Te,xe,s.history]),Fe=N.useMemo(()=>{if(Ee?.external)return bd(Ee.href,s.protocolAllowlist)?void 0:Ee.href;if(!f9(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),bd(c,s.protocolAllowlist)?void 0:c}catch{}},[c,Ee,s.protocolAllowlist]),Ge=N.useMemo(()=>{if(Fe)return!1;if(l?.exact){if(!c7(ke.pathname,pe.pathname,s.basepath))return!1}else{const He=wd(ke.pathname,s.basepath),te=wd(pe.pathname,s.basepath);if(!(He.startsWith(te)&&(He.length===te.length||He[te.length]==="/")))return!1}return(l?.includeSearch??!0)&&!di(ke.search,pe.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?ee&&ke.hash===pe.hash:!0},[l?.exact,l?.explicitUndefined,l?.includeHash,l?.includeSearch,ke,Fe,ee,pe.hash,pe.pathname,pe.search,s.basepath]),pt=Ge?Ar(i,{})??c9:Hp,sn=Ge?Hp:Ar(a,{})??Hp,On=[E,pt.className,sn.className].filter(Boolean).join(" "),dn=(T||pt.style||sn.style)&&{...T,...pt.style,...sn.style},[js,qt]=N.useState(!1),_n=N.useRef(!1),wn=e.reloadDocument||Fe?!1:u??s.options.defaultPreload,Nn=h??s.options.defaultPreloadDelay??0,Je=N.useCallback(()=>{s.preloadRoute({...O,_builtLocation:pe}).catch(He=>{console.warn(He),console.warn(W7)})},[s,O,pe]);H8(r,N.useCallback(He=>{He?.isIntersecting&&Je()},[Je]),p9,{disabled:!!S||wn!=="viewport"}),N.useEffect(()=>{_n.current||!S&&wn==="render"&&(Je(),_n.current=!0)},[S,Je,wn]);const Dt=He=>{const te=He.currentTarget.getAttribute("target"),he=w!==void 0?w:te;if(!S&&!g9(He)&&!He.defaultPrevented&&(!he||he==="_self")&&He.button===0){He.preventDefault(),kl.flushSync(()=>{qt(!0)});const Ae=s.subscribe("onResolved",()=>{Ae(),qt(!1)});s.navigate({...O,replace:x,resetScroll:j,hashScrollIntoView:p,startTransition:g,viewTransition:k,ignoreBlocker:U})}};if(Fe)return{...B,ref:r,href:Fe,...b&&{children:b},...w&&{target:w},...S&&{disabled:S},...T&&{style:T},...E&&{className:E},...z&&{onClick:z},...$&&{onBlur:$},...P&&{onFocus:P},...L&&{onMouseEnter:L},...W&&{onMouseLeave:W},...F&&{onTouchStart:F}};const Sn=He=>{if(S||wn!=="intent")return;if(!Nn){Je();return}const te=He.currentTarget;if(To.has(te))return;const he=setTimeout(()=>{To.delete(te),Je()},Nn);To.set(te,he)},ks=He=>{S||wn!=="intent"||Je()},vs=He=>{if(S||!wn||!Nn)return;const te=He.currentTarget,he=To.get(te);he&&(clearTimeout(he),To.delete(te))};return{...B,...pt,...sn,href:Ee?.href,ref:r,onClick:na([z,Dt]),onBlur:na([$,vs]),onFocus:na([P,Sn]),onMouseEnter:na([L,Sn]),onMouseLeave:na([W,vs]),onTouchStart:na([F,ks]),disabled:!!S,target:w,...dn&&{style:dn},...On&&{className:On},...S&&d9,...Ge&&u9,...ee&&js&&h9}}var Hp={},c9={className:"active"},d9={role:"link","aria-disabled":!0},u9={"data-status":"active","aria-current":"page"},h9={"data-transitioning":"transitioning"},To=new WeakMap,p9={rootMargin:"100px"},na=e=>n=>{for(const s of e)if(s){if(n.defaultPrevented)return;s(n)}};function m9(e,n,s,r){if(!r)return n?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function f9(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var ge=N.forwardRef((e,n)=>{const{_asChild:s,...r}=e,{type:i,...a}=l9(r,n),l=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!s){const{disabled:c,...u}=a;return N.createElement("a",u,l)}return N.createElement(s,a,l)});function g9(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var x9=class extends Sv{constructor(e){super(e),this.useMatch=n=>bi({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>qv({...n,from:this.id}),this.useSearch=n=>_r({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>du({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Rv({...n,from:this.id}),this.useLoaderData=n=>Pv({...n,from:this.id}),this.useNavigate=()=>_t({from:this.fullPath}),this.Link=Uo.forwardRef((n,s)=>t.jsx(ge,{ref:s,from:this.fullPath,...n}))}};function St(e){return new x9(e)}var y9=class extends U7{constructor(e){super(e),this.useMatch=n=>bi({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>qv({...n,from:this.id}),this.useSearch=n=>_r({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>du({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Rv({...n,from:this.id}),this.useLoaderData=n=>Pv({...n,from:this.id}),this.useNavigate=()=>_t({from:this.fullPath}),this.Link=Uo.forwardRef((n,s)=>t.jsx(ge,{ref:s,from:this.fullPath,...n}))}};function j9(e){return new y9(e)}function k9(e){const n=vn(),s=`not-found-${jn(n.stores.location,r=>r.pathname)}-${jn(n.stores.status,r=>r)}`;return t.jsx(t1,{getResetKey:()=>s,onCatch:(r,i)=>{if(Zt(r))e.onCatch?.(r,i);else throw r},errorComponent:({error:r})=>{if(Zt(r))return e.fallback?.(r);throw r},children:e.children})}function v9(){return t.jsx("p",{children:"Not Found"})}function oa(e){return t.jsx(t.Fragment,{children:e.children})}function Iv(e,n,s){return n.options.notFoundComponent?t.jsx(n.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?t.jsx(e.options.defaultNotFoundComponent,{...s}):t.jsx(v9,{})}function b9(e){return null}function w9(){return b9(vn()),null}var Fv=N.memo(function({matchId:n}){const s=vn(),r=s.stores.matchStores.get(n);r||Qs();const i=jn(s.stores.loadedAt,l=>l),a=jn(r,l=>l);return t.jsx(N9,{router:s,matchId:n,resetKey:i,matchState:N.useMemo(()=>{const l=a.routeId,c=s.routesById[l].parentRoute?.id;return{routeId:l,ssr:a.ssr,_displayPending:a._displayPending,parentRouteId:c}},[a._displayPending,a.routeId,a.ssr,s.routesById])})});function N9({router:e,matchId:n,resetKey:s,matchState:r}){const i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,l=a?t.jsx(a,{}):null,c=i.options.errorComponent??e.options.defaultErrorComponent,u=i.options.onCatch??e.options.defaultOnCatch,h=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,m=r.ssr===!1||r.ssr==="data-only",p=(!i.isRoot||i.options.wrapInSuspense||m)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||m))?N.Suspense:oa,x=c?t1:oa,g=h?k9:oa;return t.jsxs(i.isRoot?i.options.shellComponent??oa:oa,{children:[t.jsx(cu.Provider,{value:n,children:t.jsx(p,{fallback:l,children:t.jsx(x,{getResetKey:()=>s,errorComponent:c||n1,onCatch:(j,k)=>{if(Zt(j))throw j.routeId??=r.routeId,j;u?.(j,k)},children:t.jsx(g,{fallback:j=>{if(j.routeId??=r.routeId,!h||j.routeId&&j.routeId!==r.routeId||!j.routeId&&!i.isRoot)throw j;return N.createElement(h,j)},children:m||r._displayPending?t.jsx(V7,{fallback:l,children:t.jsx(wj,{matchId:n})}):t.jsx(wj,{matchId:n})})})})}),r.parentRouteId===ui?t.jsxs(t.Fragment,{children:[t.jsx(S9,{resetKey:s}),e.options.scrollRestoration&&uv?t.jsx(w9,{}):null]}):null]})}function S9({resetKey:e}){const n=vn(),s=N.useRef(void 0);return Io(()=>{const r=n.latestLocation.href;(s.current===void 0||s.current!==r)&&(n.emit({type:"onRendered",...ca(n.stores.location.get(),n.stores.resolvedLocation.get())}),s.current=r)},[n.latestLocation.state.__TSR_key,e,n]),null}var wj=N.memo(function({matchId:n}){const s=vn(),r=(m,p)=>s.getMatch(m.id)?._nonReactive[p]??m._nonReactive[p],i=s.stores.matchStores.get(n);i||Qs();const a=jn(i,m=>m),l=a.routeId,c=s.routesById[l],u=N.useMemo(()=>{const m=(s.routesById[l].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:l,loaderDeps:a.loaderDeps,params:a._strictParams,search:a._strictSearch});return m?JSON.stringify(m):void 0},[l,a.loaderDeps,a._strictParams,a._strictSearch,s.options.defaultRemountDeps,s.routesById]),h=N.useMemo(()=>{const m=c.options.component??s.options.defaultComponent;return m?t.jsx(m,{},u):t.jsx(Km,{})},[u,c.options.component,s.options.defaultComponent]);if(a._displayPending)throw r(a,"displayPendingPromise");if(a._forcePending)throw r(a,"minPendingPromise");if(a.status==="pending"){const m=c.options.pendingMinMs??s.options.defaultPendingMinMs;if(m){const p=s.getMatch(a.id);if(p&&!p._nonReactive.minPendingPromise){const x=fa();p._nonReactive.minPendingPromise=x,setTimeout(()=>{x.resolve(),p._nonReactive.minPendingPromise=void 0},m)}}throw r(a,"loadPromise")}if(a.status==="notFound")return Zt(a.error)||Qs(),Iv(s,c,a.error);if(a.status==="redirected")throw yn(a.error)||Qs(),r(a,"loadPromise");if(a.status==="error")throw a.error;return h}),Km=N.memo(function(){const n=vn(),s=N.useContext(cu);let r,i=!1,a;{const h=s?n.stores.matchStores.get(s):void 0;[r,i]=jn(h,m=>[m?.routeId,m?.globalNotFound??!1]),a=jn(n.stores.matchesId,m=>m[m.findIndex(p=>p===s)+1])}const l=r?n.routesById[r]:void 0,c=n.options.defaultPendingComponent?t.jsx(n.options.defaultPendingComponent,{}):null;if(i)return l||Qs(),Iv(n,l,void 0);if(!a)return null;const u=t.jsx(Fv,{matchId:a});return r===ui?t.jsx(N.Suspense,{fallback:c,children:u}):u});function C9(){const e=vn(),n=N.useRef({router:e,mounted:!1}),[s,r]=N.useState(!1),i=jn(e.stores.isLoading,p=>p),a=jn(e.stores.hasPending,p=>p),l=Ip(i),c=i||s||a,u=Ip(c),h=i||a,m=Ip(h);return e.startTransition=p=>{r(!0),N.startTransition(()=>{p(),r(!1)})},N.useEffect(()=>{const p=e.history.subscribe(e.load),x=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Gs(e.latestLocation.publicHref)!==Gs(x.publicHref)&&e.commitLocation({...x,replace:!0}),()=>{p()}},[e,e.history]),Io(()=>{if(typeof window<"u"&&e.ssr||n.current.router===e&&n.current.mounted)return;n.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(x){console.error(x)}})()},[e]),Io(()=>{l&&!i&&e.emit({type:"onLoad",...ca(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,i]),Io(()=>{m&&!h&&e.emit({type:"onBeforeRouteMount",...ca(e.stores.location.get(),e.stores.resolvedLocation.get())})},[h,m,e]),Io(()=>{if(u&&!c){const p=ca(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...p}),Ev(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())}),p.hrefChanged&&H7(e)}},[c,u,e]),null}function $9(){const e=vn(),n=e.routesById[ui].options.pendingComponent??e.options.defaultPendingComponent,s=n?t.jsx(n,{}):null,r=t.jsxs(typeof document<"u"&&e.ssr?oa:N.Suspense,{fallback:s,children:[t.jsx(C9,{}),t.jsx(T9,{})]});return e.options.InnerWrap?t.jsx(e.options.InnerWrap,{children:r}):r}function T9(){const e=vn(),n=jn(e.stores.firstId,i=>i),s=jn(e.stores.loadedAt,i=>i),r=n?t.jsx(Fv,{matchId:n}):null;return t.jsx(cu.Provider,{value:n,children:e.options.disableGlobalCatchBoundary?r:t.jsx(t1,{getResetKey:()=>s,errorComponent:n1,onCatch:void 0,children:r})})}var E9=e=>({createMutableStore:yj,createReadonlyStore:yj,batch:Ev}),A9=e=>new P9(e),P9=class extends L7{constructor(e){super(e,E9)}};function R9({router:e,children:n,...s}){pv(s)&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const r=t.jsx($v.Provider,{value:e,children:n});return e.options.Wrap?t.jsx(e.options.Wrap,{children:r}):r}function q9({router:e,...n}){return t.jsx(R9,{router:e,...n,children:t.jsx($9,{})})}function zr(e){const n=vn({warn:e?.router===void 0}),s=e?.router||n,r=N.useRef(void 0);return jn(s.stores.__store,i=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const a=Pr(r.current,e.select(i));return r.current=a,a}return e.select(i)}return i})}let Xo="up",$d=0,Lv=!1;const Td=new Set;function s1(e){if(e!==Xo){Xo=e;for(const n of Td)n()}}function I9(e){$d=0,s1(e===401?"link-old":"up")}function zv(){$d+=1,$d>=2&&s1("down")}function F9(){$d=0,Xo==="down"&&s1("up")}function da(e){Lv=e;for(const n of Td)n()}function L9(){return Lv&&Xo==="down"?"up":Xo}function z9(e){return Td.add(e),()=>Td.delete(e)}const Ed="squad.console.token";let Ad=null;function Nj(e){try{return e().getItem(Ed)}catch{return null}}function Ea(){return Ad??Nj(()=>localStorage)??Nj(()=>sessionStorage)}function M9(e){Ad=e;try{localStorage.setItem(Ed,e)}catch{}}function Mv(e){Ad===e&&(Ad=null);for(const n of[()=>localStorage,()=>sessionStorage])try{n().getItem(Ed)===e&&n().removeItem(Ed)}catch{}}const gt=(()=>{const e=/^\/p\/([^/]+)/.exec(window.location.pathname);return e?decodeURIComponent(e[1]):null})(),ga=gt?`/p/${encodeURIComponent(gt)}`:"";function vl(e){return!ga||!e.startsWith("/api/")||e.startsWith("/api/v1/app/")?e:ga+e}function O9(){const e=new URL(window.location.href),n=e.searchParams.get("t");return n?(M9(n),e.searchParams.delete("t"),window.history.replaceState({},"",e.toString()),n):Ea()}class Jo extends Error{constructor(){super("This page's link is out of date. Run squad in a terminal: it opens the board with a fresh link."),this.name="UnauthorizedError"}}class uu extends Error{constructor(n,s){super(n),this.status=s,this.name="ApiError"}}function Ov(e){return e instanceof Error&&(e.message===r1||e instanceof uu&&e.status>=500)}const r1="squad-kit did not answer, so this may not have gone through. Check that it still runs in its terminal, then try again.";async function _v(e,n){let s;try{s=await fetch(e,n)}catch{throw zv(),new Error(r1)}return I9(s.status),s}async function ye(e,n){const s=Ea();if(!s)throw new Jo;const r=await _v(vl(e),{...n,headers:{"content-type":"application/json",authorization:`Bearer ${s}`}});if(r.status===401)throw Mv(s),new Jo;if(!r.ok){const i=await _9(r);throw new Error(`${r.status} ${r.statusText}: ${i}`)}return await r.json()}async function _9(e){try{return(await e.text()).slice(0,400)}catch{return""}}async function et(e,n,s={}){const r=Ea();if(!r)throw new Jo;const i=await _v(vl(e),{method:n,headers:{"content-type":"application/json",authorization:`Bearer ${r}`},body:JSON.stringify(s)});if(i.status===401)throw Mv(r),new Jo;const a=await i.json().catch(()=>({}));if(!i.ok)throw new uu(a.error??`${i.status} ${i.statusText}`,i.status);return a}function In(e,n){const s=Ea()??"";return`${vl(`/api/v1/tickets/${encodeURIComponent(e)}/file`)}?path=${encodeURIComponent(n.replace(/^file:\/\//,""))}&t=${encodeURIComponent(s)}`}function Mt(e){const n=Ea()??"";return`${vl(e)}?t=${encodeURIComponent(n)}`}/**
57
+ * @license lucide-react v0.460.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const D9=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Dv=(...e)=>e.filter((n,s,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===s).join(" ").trim();/**
62
+ * @license lucide-react v0.460.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */var B9={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
67
+ * @license lucide-react v0.460.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const W9=N.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:l,...c},u)=>N.createElement("svg",{ref:u,...B9,width:n,height:n,stroke:e,strokeWidth:r?Number(s)*24/Number(n):s,className:Dv("lucide",i),...c},[...l.map(([h,m])=>N.createElement(h,m)),...Array.isArray(a)?a:[a]]));/**
72
+ * @license lucide-react v0.460.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const ie=(e,n)=>{const s=N.forwardRef(({className:r,...i},a)=>N.createElement(W9,{ref:a,iconNode:n,className:Dv(`lucide-${D9(e)}`,r),...i}));return s.displayName=`${e}`,s};/**
77
+ * @license lucide-react v0.460.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const Bv=ie("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
82
+ * @license lucide-react v0.460.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const Pd=ie("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
87
+ * @license lucide-react v0.460.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const Wv=ie("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
92
+ * @license lucide-react v0.460.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const Uv=ie("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
97
+ * @license lucide-react v0.460.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const Rd=ie("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/**
102
+ * @license lucide-react v0.460.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const xa=ie("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
107
+ * @license lucide-react v0.460.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const Vm=ie("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
112
+ * @license lucide-react v0.460.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const Zn=ie("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
117
+ * @license lucide-react v0.460.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const Ym=ie("BellRing",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]]);/**
122
+ * @license lucide-react v0.460.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const U9=ie("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
127
+ * @license lucide-react v0.460.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const Hv=ie("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
132
+ * @license lucide-react v0.460.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const Js=ie("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);/**
137
+ * @license lucide-react v0.460.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const ce=ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
142
+ * @license lucide-react v0.460.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const Aa=ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
147
+ * @license lucide-react v0.460.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const Kv=ie("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
152
+ * @license lucide-react v0.460.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const hu=ie("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
157
+ * @license lucide-react v0.460.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const Vv=ie("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
162
+ * @license lucide-react v0.460.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const H9=ie("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
167
+ * @license lucide-react v0.460.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const Fn=ie("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
172
+ * @license lucide-react v0.460.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const Sj=ie("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
177
+ * @license lucide-react v0.460.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const K9=ie("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
182
+ * @license lucide-react v0.460.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const V9=ie("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);/**
187
+ * @license lucide-react v0.460.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const Y9=ie("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
192
+ * @license lucide-react v0.460.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const i1=ie("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
197
+ * @license lucide-react v0.460.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const Yv=ie("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
202
+ * @license lucide-react v0.460.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const bl=ie("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
207
+ * @license lucide-react v0.460.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const a1=ie("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
212
+ * @license lucide-react v0.460.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const Mn=ie("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
217
+ * @license lucide-react v0.460.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const G9=ie("CornerLeftUp",[["polyline",{points:"14 9 9 4 4 9",key:"m9oyvo"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]]);/**
222
+ * @license lucide-react v0.460.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const Q9=ie("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
227
+ * @license lucide-react v0.460.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const gs=ie("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
232
+ * @license lucide-react v0.460.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const Gv=ie("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
237
+ * @license lucide-react v0.460.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const Xt=ie("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
242
+ * @license lucide-react v0.460.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const Qv=ie("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
247
+ * @license lucide-react v0.460.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const Pa=ie("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
252
+ * @license lucide-react v0.460.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const Dr=ie("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
257
+ * @license lucide-react v0.460.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const Zv=ie("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
262
+ * @license lucide-react v0.460.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const Z9=ie("FolderCheck",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"m9 13 2 2 4-4",key:"6343dt"}]]);/**
267
+ * @license lucide-react v0.460.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const X9=ie("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/**
272
+ * @license lucide-react v0.460.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const o1=ie("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
277
+ * @license lucide-react v0.460.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const Gm=ie("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
282
+ * @license lucide-react v0.460.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const J9=ie("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
287
+ * @license lucide-react v0.460.0 - ISC
288
+ *
289
+ * This source code is licensed under the ISC license.
290
+ * See the LICENSE file in the root directory of this source tree.
291
+ */const Xv=ie("Forward",[["polyline",{points:"15 17 20 12 15 7",key:"1w3sku"}],["path",{d:"M4 18v-2a4 4 0 0 1 4-4h12",key:"jmiej9"}]]);/**
292
+ * @license lucide-react v0.460.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */const Qm=ie("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
297
+ * @license lucide-react v0.460.0 - ISC
298
+ *
299
+ * This source code is licensed under the ISC license.
300
+ * See the LICENSE file in the root directory of this source tree.
301
+ */const pu=ie("GitMerge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);/**
302
+ * @license lucide-react v0.460.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ */const eS=ie("GitPullRequestArrow",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M5 9v12",key:"ih889a"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}]]);/**
307
+ * @license lucide-react v0.460.0 - ISC
308
+ *
309
+ * This source code is licensed under the ISC license.
310
+ * See the LICENSE file in the root directory of this source tree.
311
+ */const mu=ie("GitPullRequest",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]);/**
312
+ * @license lucide-react v0.460.0 - ISC
313
+ *
314
+ * This source code is licensed under the ISC license.
315
+ * See the LICENSE file in the root directory of this source tree.
316
+ */const tS=ie("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
317
+ * @license lucide-react v0.460.0 - ISC
318
+ *
319
+ * This source code is licensed under the ISC license.
320
+ * See the LICENSE file in the root directory of this source tree.
321
+ */const nS=ie("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
322
+ * @license lucide-react v0.460.0 - ISC
323
+ *
324
+ * This source code is licensed under the ISC license.
325
+ * See the LICENSE file in the root directory of this source tree.
326
+ */const sS=ie("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
327
+ * @license lucide-react v0.460.0 - ISC
328
+ *
329
+ * This source code is licensed under the ISC license.
330
+ * See the LICENSE file in the root directory of this source tree.
331
+ */const Zm=ie("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);/**
332
+ * @license lucide-react v0.460.0 - ISC
333
+ *
334
+ * This source code is licensed under the ISC license.
335
+ * See the LICENSE file in the root directory of this source tree.
336
+ */const rS=ie("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
337
+ * @license lucide-react v0.460.0 - ISC
338
+ *
339
+ * This source code is licensed under the ISC license.
340
+ * See the LICENSE file in the root directory of this source tree.
341
+ */const iS=ie("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
342
+ * @license lucide-react v0.460.0 - ISC
343
+ *
344
+ * This source code is licensed under the ISC license.
345
+ * See the LICENSE file in the root directory of this source tree.
346
+ */const Jv=ie("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
347
+ * @license lucide-react v0.460.0 - ISC
348
+ *
349
+ * This source code is licensed under the ISC license.
350
+ * See the LICENSE file in the root directory of this source tree.
351
+ */const eb=ie("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
352
+ * @license lucide-react v0.460.0 - ISC
353
+ *
354
+ * This source code is licensed under the ISC license.
355
+ * See the LICENSE file in the root directory of this source tree.
356
+ */const l1=ie("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/**
357
+ * @license lucide-react v0.460.0 - ISC
358
+ *
359
+ * This source code is licensed under the ISC license.
360
+ * See the LICENSE file in the root directory of this source tree.
361
+ */const aS=ie("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
362
+ * @license lucide-react v0.460.0 - ISC
363
+ *
364
+ * This source code is licensed under the ISC license.
365
+ * See the LICENSE file in the root directory of this source tree.
366
+ */const tb=ie("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
367
+ * @license lucide-react v0.460.0 - ISC
368
+ *
369
+ * This source code is licensed under the ISC license.
370
+ * See the LICENSE file in the root directory of this source tree.
371
+ */const oS=ie("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
372
+ * @license lucide-react v0.460.0 - ISC
373
+ *
374
+ * This source code is licensed under the ISC license.
375
+ * See the LICENSE file in the root directory of this source tree.
376
+ */const nb=ie("ListTree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/**
377
+ * @license lucide-react v0.460.0 - ISC
378
+ *
379
+ * This source code is licensed under the ISC license.
380
+ * See the LICENSE file in the root directory of this source tree.
381
+ */const Xe=ie("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
382
+ * @license lucide-react v0.460.0 - ISC
383
+ *
384
+ * This source code is licensed under the ISC license.
385
+ * See the LICENSE file in the root directory of this source tree.
386
+ */const fu=ie("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
387
+ * @license lucide-react v0.460.0 - ISC
388
+ *
389
+ * This source code is licensed under the ISC license.
390
+ * See the LICENSE file in the root directory of this source tree.
391
+ */const lS=ie("Map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]);/**
392
+ * @license lucide-react v0.460.0 - ISC
393
+ *
394
+ * This source code is licensed under the ISC license.
395
+ * See the LICENSE file in the root directory of this source tree.
396
+ */const el=ie("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
397
+ * @license lucide-react v0.460.0 - ISC
398
+ *
399
+ * This source code is licensed under the ISC license.
400
+ * See the LICENSE file in the root directory of this source tree.
401
+ */const cS=ie("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
402
+ * @license lucide-react v0.460.0 - ISC
403
+ *
404
+ * This source code is licensed under the ISC license.
405
+ * See the LICENSE file in the root directory of this source tree.
406
+ */const Xn=ie("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
407
+ * @license lucide-react v0.460.0 - ISC
408
+ *
409
+ * This source code is licensed under the ISC license.
410
+ * See the LICENSE file in the root directory of this source tree.
411
+ */const Cj=ie("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
412
+ * @license lucide-react v0.460.0 - ISC
413
+ *
414
+ * This source code is licensed under the ISC license.
415
+ * See the LICENSE file in the root directory of this source tree.
416
+ */const ya=ie("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/**
417
+ * @license lucide-react v0.460.0 - ISC
418
+ *
419
+ * This source code is licensed under the ISC license.
420
+ * See the LICENSE file in the root directory of this source tree.
421
+ */const $j=ie("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
422
+ * @license lucide-react v0.460.0 - ISC
423
+ *
424
+ * This source code is licensed under the ISC license.
425
+ * See the LICENSE file in the root directory of this source tree.
426
+ */const sb=ie("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
427
+ * @license lucide-react v0.460.0 - ISC
428
+ *
429
+ * This source code is licensed under the ISC license.
430
+ * See the LICENSE file in the root directory of this source tree.
431
+ */const Ra=ie("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
432
+ * @license lucide-react v0.460.0 - ISC
433
+ *
434
+ * This source code is licensed under the ISC license.
435
+ * See the LICENSE file in the root directory of this source tree.
436
+ */const dS=ie("MonitorOff",[["path",{d:"M17 17H4a2 2 0 0 1-2-2V5c0-1.5 1-2 1-2",key:"k0q8oc"}],["path",{d:"M22 15V5a2 2 0 0 0-2-2H9",key:"cp1ac0"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
437
+ * @license lucide-react v0.460.0 - ISC
438
+ *
439
+ * This source code is licensed under the ISC license.
440
+ * See the LICENSE file in the root directory of this source tree.
441
+ */const uS=ie("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
442
+ * @license lucide-react v0.460.0 - ISC
443
+ *
444
+ * This source code is licensed under the ISC license.
445
+ * See the LICENSE file in the root directory of this source tree.
446
+ */const wl=ie("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
447
+ * @license lucide-react v0.460.0 - ISC
448
+ *
449
+ * This source code is licensed under the ISC license.
450
+ * See the LICENSE file in the root directory of this source tree.
451
+ */const hS=ie("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
452
+ * @license lucide-react v0.460.0 - ISC
453
+ *
454
+ * This source code is licensed under the ISC license.
455
+ * See the LICENSE file in the root directory of this source tree.
456
+ */const qd=ie("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
457
+ * @license lucide-react v0.460.0 - ISC
458
+ *
459
+ * This source code is licensed under the ISC license.
460
+ * See the LICENSE file in the root directory of this source tree.
461
+ */const Nl=ie("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
462
+ * @license lucide-react v0.460.0 - ISC
463
+ *
464
+ * This source code is licensed under the ISC license.
465
+ * See the LICENSE file in the root directory of this source tree.
466
+ */const tl=ie("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
467
+ * @license lucide-react v0.460.0 - ISC
468
+ *
469
+ * This source code is licensed under the ISC license.
470
+ * See the LICENSE file in the root directory of this source tree.
471
+ */const Ps=ie("PencilLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}],["path",{d:"m15 5 3 3",key:"1w25hb"}]]);/**
472
+ * @license lucide-react v0.460.0 - ISC
473
+ *
474
+ * This source code is licensed under the ISC license.
475
+ * See the LICENSE file in the root directory of this source tree.
476
+ */const Id=ie("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
477
+ * @license lucide-react v0.460.0 - ISC
478
+ *
479
+ * This source code is licensed under the ISC license.
480
+ * See the LICENSE file in the root directory of this source tree.
481
+ */const kn=ie("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
482
+ * @license lucide-react v0.460.0 - ISC
483
+ *
484
+ * This source code is licensed under the ISC license.
485
+ * See the LICENSE file in the root directory of this source tree.
486
+ */const rb=ie("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
487
+ * @license lucide-react v0.460.0 - ISC
488
+ *
489
+ * This source code is licensed under the ISC license.
490
+ * See the LICENSE file in the root directory of this source tree.
491
+ */const jt=ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
492
+ * @license lucide-react v0.460.0 - ISC
493
+ *
494
+ * This source code is licensed under the ISC license.
495
+ * See the LICENSE file in the root directory of this source tree.
496
+ */const pS=ie("Pointer",[["path",{d:"M22 14a8 8 0 0 1-8 8",key:"56vcr3"}],["path",{d:"M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1agjmk"}],["path",{d:"M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1",key:"wdbh2u"}],["path",{d:"M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10",key:"1ibuk9"}],["path",{d:"M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"g6ys72"}]]);/**
497
+ * @license lucide-react v0.460.0 - ISC
498
+ *
499
+ * This source code is licensed under the ISC license.
500
+ * See the LICENSE file in the root directory of this source tree.
501
+ */const xs=ie("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
502
+ * @license lucide-react v0.460.0 - ISC
503
+ *
504
+ * This source code is licensed under the ISC license.
505
+ * See the LICENSE file in the root directory of this source tree.
506
+ */const mS=ie("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/**
507
+ * @license lucide-react v0.460.0 - ISC
508
+ *
509
+ * This source code is licensed under the ISC license.
510
+ * See the LICENSE file in the root directory of this source tree.
511
+ */const Fo=ie("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
512
+ * @license lucide-react v0.460.0 - ISC
513
+ *
514
+ * This source code is licensed under the ISC license.
515
+ * See the LICENSE file in the root directory of this source tree.
516
+ */const gi=ie("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
517
+ * @license lucide-react v0.460.0 - ISC
518
+ *
519
+ * This source code is licensed under the ISC license.
520
+ * See the LICENSE file in the root directory of this source tree.
521
+ */const fS=ie("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
522
+ * @license lucide-react v0.460.0 - ISC
523
+ *
524
+ * This source code is licensed under the ISC license.
525
+ * See the LICENSE file in the root directory of this source tree.
526
+ */const wi=ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
527
+ * @license lucide-react v0.460.0 - ISC
528
+ *
529
+ * This source code is licensed under the ISC license.
530
+ * See the LICENSE file in the root directory of this source tree.
531
+ */const qs=ie("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
532
+ * @license lucide-react v0.460.0 - ISC
533
+ *
534
+ * This source code is licensed under the ISC license.
535
+ * See the LICENSE file in the root directory of this source tree.
536
+ */const gS=ie("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
537
+ * @license lucide-react v0.460.0 - ISC
538
+ *
539
+ * This source code is licensed under the ISC license.
540
+ * See the LICENSE file in the root directory of this source tree.
541
+ */const xS=ie("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/**
542
+ * @license lucide-react v0.460.0 - ISC
543
+ *
544
+ * This source code is licensed under the ISC license.
545
+ * See the LICENSE file in the root directory of this source tree.
546
+ */const c1=ie("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
547
+ * @license lucide-react v0.460.0 - ISC
548
+ *
549
+ * This source code is licensed under the ISC license.
550
+ * See the LICENSE file in the root directory of this source tree.
551
+ */const ja=ie("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
552
+ * @license lucide-react v0.460.0 - ISC
553
+ *
554
+ * This source code is licensed under the ISC license.
555
+ * See the LICENSE file in the root directory of this source tree.
556
+ */const Tj=ie("ShieldOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]);/**
557
+ * @license lucide-react v0.460.0 - ISC
558
+ *
559
+ * This source code is licensed under the ISC license.
560
+ * See the LICENSE file in the root directory of this source tree.
561
+ */const yS=ie("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/**
562
+ * @license lucide-react v0.460.0 - ISC
563
+ *
564
+ * This source code is licensed under the ISC license.
565
+ * See the LICENSE file in the root directory of this source tree.
566
+ */const zo=ie("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
567
+ * @license lucide-react v0.460.0 - ISC
568
+ *
569
+ * This source code is licensed under the ISC license.
570
+ * See the LICENSE file in the root directory of this source tree.
571
+ */const d1=ie("SquareCheck",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
572
+ * @license lucide-react v0.460.0 - ISC
573
+ *
574
+ * This source code is licensed under the ISC license.
575
+ * See the LICENSE file in the root directory of this source tree.
576
+ */const Ej=ie("SquarePlus",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
577
+ * @license lucide-react v0.460.0 - ISC
578
+ *
579
+ * This source code is licensed under the ISC license.
580
+ * See the LICENSE file in the root directory of this source tree.
581
+ */const Jn=ie("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
582
+ * @license lucide-react v0.460.0 - ISC
583
+ *
584
+ * This source code is licensed under the ISC license.
585
+ * See the LICENSE file in the root directory of this source tree.
586
+ */const Sl=ie("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
587
+ * @license lucide-react v0.460.0 - ISC
588
+ *
589
+ * This source code is licensed under the ISC license.
590
+ * See the LICENSE file in the root directory of this source tree.
591
+ */const nl=ie("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
592
+ * @license lucide-react v0.460.0 - ISC
593
+ *
594
+ * This source code is licensed under the ISC license.
595
+ * See the LICENSE file in the root directory of this source tree.
596
+ */const zn=ie("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
597
+ * @license lucide-react v0.460.0 - ISC
598
+ *
599
+ * This source code is licensed under the ISC license.
600
+ * See the LICENSE file in the root directory of this source tree.
601
+ */const Is=ie("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
602
+ * @license lucide-react v0.460.0 - ISC
603
+ *
604
+ * This source code is licensed under the ISC license.
605
+ * See the LICENSE file in the root directory of this source tree.
606
+ */const jS=ie("Triangle",[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]]);/**
607
+ * @license lucide-react v0.460.0 - ISC
608
+ *
609
+ * This source code is licensed under the ISC license.
610
+ * See the LICENSE file in the root directory of this source tree.
611
+ */const ib=ie("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
612
+ * @license lucide-react v0.460.0 - ISC
613
+ *
614
+ * This source code is licensed under the ISC license.
615
+ * See the LICENSE file in the root directory of this source tree.
616
+ */const kS=ie("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
617
+ * @license lucide-react v0.460.0 - ISC
618
+ *
619
+ * This source code is licensed under the ISC license.
620
+ * See the LICENSE file in the root directory of this source tree.
621
+ */const u1=ie("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
622
+ * @license lucide-react v0.460.0 - ISC
623
+ *
624
+ * This source code is licensed under the ISC license.
625
+ * See the LICENSE file in the root directory of this source tree.
626
+ */const vS=ie("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
627
+ * @license lucide-react v0.460.0 - ISC
628
+ *
629
+ * This source code is licensed under the ISC license.
630
+ * See the LICENSE file in the root directory of this source tree.
631
+ */const bS=ie("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
632
+ * @license lucide-react v0.460.0 - ISC
633
+ *
634
+ * This source code is licensed under the ISC license.
635
+ * See the LICENSE file in the root directory of this source tree.
636
+ */const ab=ie("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/**
637
+ * @license lucide-react v0.460.0 - ISC
638
+ *
639
+ * This source code is licensed under the ISC license.
640
+ * See the LICENSE file in the root directory of this source tree.
641
+ */const sl=ie("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
642
+ * @license lucide-react v0.460.0 - ISC
643
+ *
644
+ * This source code is licensed under the ISC license.
645
+ * See the LICENSE file in the root directory of this source tree.
646
+ */const Ue=ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function wS(e){return e==="err"?null:3200}function NS(e,n){return n.kind==="err"&&e.some(s=>s.kind==="err"&&s.text===n.text)?e:[...e,n]}let ob=null;const Xm=new Set;function Aj(e){ob=e;for(const n of Xm)n()}const Cl={open:(e={})=>Aj(e),close:()=>Aj(null)};function SS(){return N.useSyncExternalStore(e=>(Xm.add(e),()=>Xm.delete(e)),()=>ob)}const lb=N.createContext(null);function fd(e){try{return localStorage.getItem(e)}catch{return null}}function Xc(e,n){try{localStorage.setItem(e,n)}catch{}}function cb(){const e=fd("sk.theme");return e==="light"||e==="dark"?e:window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function Pj({children:e}){const[n,s]=N.useState(cb),[r,i]=N.useState(fd("sk.commands")!=="off"),[a,l]=N.useState(fd("sk.ticketFull")==="on"),[c,u]=N.useState(fd("sk.engineers")==="on"),[h,m]=N.useState([]);N.useEffect(()=>{document.documentElement.dataset.theme=n,Xc("sk.theme",n)},[n]);const p=N.useCallback(j=>m(k=>k.filter(b=>b.id!==j)),[]),x=N.useCallback((j,k="ok",b)=>{const w=Date.now()+Math.random();m(T=>NS(T,{id:w,text:j,kind:k,...b?{retry:b}:{}}));const S=wS(k);S!==null&&setTimeout(()=>p(w),S)},[p]),g=N.useMemo(()=>({theme:n,toggleTheme:()=>s(j=>j==="light"?"dark":"light"),showCommands:r,toggleCommands:()=>i(j=>(Xc("sk.commands",j?"off":"on"),!j)),ticketFull:a,toggleTicketFull:()=>l(j=>(Xc("sk.ticketFull",j?"off":"on"),!j)),engineers:c,toggleEngineers:()=>u(j=>(Xc("sk.engineers",j?"off":"on"),!j)),toast:x}),[n,r,a,c,x]);return t.jsxs(lb.Provider,{value:g,children:[e,t.jsx("div",{className:"toasts",role:"status","aria-live":"polite",children:h.map(j=>j.kind==="err"?t.jsxs("div",{className:"toast err",role:"alert",children:[t.jsx(Fn,{size:16}),t.jsx("span",{className:"grow",children:j.text}),j.retry&&t.jsx("button",{className:"toast-act",onClick:()=>{p(j.id),j.retry()},children:"Try again"}),t.jsx("button",{className:"toast-act",onClick:()=>{p(j.id),Cl.open()},children:"Report a problem"}),t.jsx("button",{className:"toast-x",onClick:()=>p(j.id),"aria-label":"Close this message",children:t.jsx(Ue,{size:15})})]},j.id):t.jsxs("div",{className:"toast",children:[t.jsx(ce,{size:16}),j.text]},j.id))})]})}function Le(){const e=N.useContext(lb);if(!e)throw new Error("usePrefs outside PrefsProvider");return e}function CS(e,n){return e instanceof Jo?{text:e.message,home:!1}:e instanceof Error&&e.message===r1?{text:`squad-kit did not answer, so ${n} could not load. Check that it still runs in its terminal, then press Try again.`,home:!1}:e instanceof Error&&/^404\b/.test(e.message)?{text:`${n[0].toUpperCase()}${n.slice(1)} could not load: this project is not open in squad-kit now. Add it again from Home.`,home:!0}:{text:`${n[0].toUpperCase()}${n.slice(1)} could not load. Nothing is lost. Press Try again.`,home:!1}}const Jm="؀-ۿݐ-ݿࢠ-ࣿﭐ-﷿ﹰ-\uFEFF",$S=new RegExp(`[${Jm}]`,"g"),TS=/[A-Za-z]/g;function tt(e){const n=String(e??"").replace(/```[\s\S]*?(```|$)/g," ").replace(/`[^`]*`/g," ").replace(/(https?:\/\/|file:\/\/)\S+/g," "),s=n.match($S)?.length??0,r=n.match(TS)?.length??0,i=s+r;if(!i)return{lang:"none",dir:"ltr",share:0};const a=s/i;return{lang:a>=.85?"ar":a<=.15?"en":"mixed",dir:a>=.5?"rtl":"ltr",share:a}}function Fs(e){return e.dir==="rtl"?"t-ar":e.lang==="mixed"?"t-mx":"t-en"}function ES(e){const n=e.dir==="rtl"?"right to left":"left to right";return e.lang==="ar"?`Arabic · ${n}`:e.lang==="en"?`English · ${n}`:e.lang==="mixed"?`Mixed · ${n}`:""}const db="[0-9\\u0660-\\u0669][0-9\\u0660-\\u0669.,:%/+\\-]*",Rj="(?:[A-Za-z0-9._\\-/+#@:]*[A-Za-z0-9#+])?",AS=`(?:${db}[  ]+)*[A-Za-z]${Rj}(?:[  ]+[A-Za-z0-9]${Rj})*`,PS=`[${Jm}]+(?:[  ]+(?:${db}[  ]+)*[${Jm}]+)*`,RS=new RegExp(`(${AS})|(${PS})`,"g");function ub(e,n){const s=[];let r=0;const i=(a,l)=>{if(!a)return;const c=s.at(-1);c&&!c.dir&&!l?c.text+=a:s.push(l?{text:a,dir:l}:{text:a})};for(const a of e.matchAll(RS)){const l=a.index??0;i(e.slice(r,l));const c=!!a[1];i(a[0],c&&n==="rtl"?"ltr":!c&&n==="ltr"?"rtl":void 0),r=l+a[0].length}return i(e.slice(r)),s}function hb(e){const n=e.filter(s=>s==="rtl").length;return e.length&&n*2>=e.length?"rtl":"ltr"}function ze(e){const{dir:n}=tt(e);return{dir:n,lang:n==="rtl"?"ar":"en"}}function je(e){return e.trim()?tt(e).dir:"auto"}function qS(e){return hb(e.flat().map(tt).filter(n=>n.lang!=="none").map(n=>n.dir))}function es(e){return`⁨${e}⁩`}function Fd(e,n){if(n<=0)return"";let s=0;for(const r of e.matchAll(/\S+/g))if(s+=1,s===n)return e.slice(0,(r.index??0)+r[0].length);return e}function Ld(e){return e.match(/\S+/g)?.length??0}const pb=new Set(["p","li","h1","h2","h3","h4","h5","h6","td","th","dt","dd","figcaption"]),h1=new Set(["code","pre","svg","math"]);function mb(e,n=!1){return e.type==="text"?e.value??"":e.tagName&&h1.has(e.tagName)||n&&e.tagName&&(e.tagName==="ul"||e.tagName==="ol")?" ":(e.children??[]).map(s=>mb(s,!0)).join("")}function IS(e,n){const s=e.properties??={},r=Array.isArray(s.className)?s.className:typeof s.className=="string"?[s.className]:[];s.className=[...r,n]}function p1(e,n,s){return{type:"element",tagName:e,properties:n,children:s}}function fb(e,n,s){if(!e.children||e.tagName&&h1.has(e.tagName))return;const r=[];for(const i of e.children){if(i.type!=="text"){i.type==="element"&&!(i.tagName&&pb.has(i.tagName))&&fb(i,n,s),r.push(i);continue}for(const a of ub(i.value??"",n)){const l=s?FS(a.text):[{type:"text",value:a.text}];a.dir?r.push(p1("bdi",{dir:a.dir},l)):r.push(...l)}}e.children=r}function FS(e){return e.split(/(\s+)/).filter(Boolean).map(n=>/^\s+$/.test(n)?{type:"text",value:n}:p1("span",{className:["fx"]},[{type:"text",value:n}]))}function LS(e,n={}){let s=null;const r=i=>{if(i.type==="element"&&i.tagName&&h1.has(i.tagName)){i.tagName==="code"&&((i.properties??={}).dir="ltr"),i.tagName==="pre"&&(s=i);return}if(i.type==="element"&&i.tagName&&pb.has(i.tagName)){const a=tt(mb(i));if(a.lang!=="none"){const l=i.properties??={};l.dir=a.dir,l.lang=a.dir==="rtl"?"ar":"en",IS(i,Fs(a))}fb(i,a.dir,!!n.stream),s=i}for(const a of i.children??[])r(a);if(i.type==="element"&&(i.tagName==="ul"||i.tagName==="ol"||i.tagName==="table")){const a=[],l=c=>{for(const u of c.children??[]){if(u.type!=="element")continue;const h=u.tagName==="li"||u.tagName==="td"||u.tagName==="th";h&&u.properties?.dir&&a.push(u.properties.dir),(!h||i.tagName==="table")&&l(u)}};l(i),a.length&&((i.properties??={}).dir=hb(a))}};return r(e),n.caret&&s&&s.tagName!=="pre"&&(s.children??=[]).push(p1("span",{className:["caret"],ariaHidden:"true"},[])),e}function m1(e={}){return n=>{LS(n,e)}}const Zs={analyst:"Analyst",architect:"Architect",spec:"Spec writer",builder:"Builder",tester:"Tester",reviewer:"Reviewer",release:"Release",triage:"Triage",you:"You",squad:"Squad"},zS={analyst:wi,architect:jS,spec:tl,builder:bl,tester:d1,reviewer:Pa,release:Zn,triage:Js,you:vS,squad:bS};function Ni({role:e,small:n,size:s}){const r=zS[e];return t.jsx("span",{className:`glyph ${n?"sm":""} ${e==="you"?"you":""}`,title:Zs[e],children:t.jsx(r,{size:s??(n?12:14),strokeWidth:2})})}function Jt({text:e,dir:n}){return t.jsx(t.Fragment,{children:ub(String(e??""),n).map((s,r)=>s.dir?t.jsx("bdi",{dir:s.dir,children:s.text},r):s.text)})}function R({text:e,lead:n,as:s="span",children:r,...i}){const{dir:a}=tt(e);return t.jsxs(s,{...i,dir:a,lang:a==="rtl"?"ar":"en",children:[n&&t.jsxs(t.Fragment,{children:[a==="rtl"?t.jsx("bdi",{dir:"ltr",children:n}):n," "]}),t.jsx(Jt,{text:e,dir:a}),r]})}function f1({text:e,as:n="div",...s}){return t.jsx(n,{...s,children:e.trimEnd().split(`
647
+ `).map((r,i)=>r.trim()?t.jsx(R,{className:"wline",text:r},i):t.jsx("br",{},i))})}function gb({path:e}){return tt(e).share?t.jsx(t.Fragment,{children:e.split(" › ").map((n,s)=>t.jsxs(N.Fragment,{children:[s>0&&" › ",t.jsx(R,{text:n})]},s))}):t.jsx(t.Fragment,{children:e})}function X({text:e,keep:n,always:s}){const{showCommands:r,toast:i}=Le();if(!r&&!s)return null;const a=()=>{navigator.clipboard?.writeText(e).then(()=>i("Command copied"),()=>i("Could not copy. Select the text instead.","err"))},l=n&&e.endsWith(n)&&e.length>n.length?e.length-n.length:0;return t.jsxs("span",{className:"term",dir:"ltr",title:"The same action in the terminal",children:[t.jsx("b",{children:">_"}),l?t.jsxs(t.Fragment,{children:[t.jsx("span",{children:e.slice(0,l).trimEnd()}),t.jsx("span",{className:"term-keep",children:n})]}):t.jsx("span",{children:e}),t.jsx("button",{onClick:a,"aria-label":`Copy ${e}`,children:t.jsx(Mn,{size:13})})]})}const Kp=[{stage:"tickets",name:"Tickets"},{stage:"specs",name:"Specs"},{stage:"implement",name:"Implement"},{stage:"test",name:"Test"},{stage:"review",name:"Review"},{stage:"release",name:"Release"}];function MS({ticket:e}){const n=e.stage==="bugs"?"tickets":e.stage,s=n==="done"?Kp.length:Kp.findIndex(l=>l.stage===n),r=e.waiting&&!e.now?.merging?"you":"work",i=new Map((e.now?.stages??[]).map(l=>[l.stage,l.note])),a=new Map((e.now?.stages??[]).filter(l=>l.wait).map(l=>[l.stage,l.wait]));return t.jsx("div",{className:"track","aria-label":"Where this ticket is",children:Kp.map((l,c)=>{const u=c<s?"done":c===s?`cur ${r}`:"",h=i.get(l.stage);return t.jsxs("div",{className:`ts ${u}`,children:[t.jsx("span",{className:"nd",children:c<s?t.jsx(ce,{size:12,strokeWidth:3}):null}),l.name,c===s&&t.jsx("span",{className:"tag",children:r==="you"?"Your turn":e.now?.merging?"Working":e.stage==="release"?"Ready":e.dependency?.way==="wait"&&!e.dependency.started&&!e.squad?"Waiting":"Working"}),i.size>0&&t.jsx("span",{className:"tnote",children:c===s&&h==="your turn"?"":l.stage==="release"&&e.sendAs?"as a pull request":h??""}),a.has(l.stage)&&t.jsx("span",{className:"tnote twait",children:a.get(l.stage)})]},l.stage)})})}function Ye({title:e,onClose:n,children:s,footer:r,icon:i,wide:a,losing:l}){const[c,u]=N.useState(!1),h=N.useCallback(()=>l?u(!0):n(),[l,n]);return N.useEffect(()=>{const m=p=>p.key==="Escape"&&h();return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[h]),kl.createPortal(t.jsx("div",{className:"modal-veil",onMouseDown:m=>m.target===m.currentTarget&&h(),children:t.jsxs("div",{className:`modal ${a?"wide":""}`,role:"dialog","aria-modal":"true","aria-label":e,children:[t.jsxs("header",{children:[i,t.jsx(R,{as:"h3",text:e}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"iconbtn",onClick:h,"aria-label":"Close",children:t.jsx(Ue,{size:16})})]}),t.jsx("div",{className:"mb",children:s}),c?t.jsxs("footer",{role:"alertdialog","aria-label":"Close this window?",children:[t.jsxs("span",{className:"grow",children:["Close and lose ",l,"? What you typed stays as a draft."]}),t.jsx("button",{className:"btn pri",autoFocus:!0,onClick:()=>u(!1),children:"Keep working"}),t.jsx("button",{className:"btn",onClick:n,children:"Close"})]}):r&&t.jsx("footer",{children:r})]})}),document.body)}function ys({what:e,error:n,onRetry:s}){const r=CS(n,e);return t.jsx("div",{className:"center",children:t.jsxs("div",{role:"alert",children:[t.jsx("h2",{children:"This did not load"}),t.jsx("p",{children:r.text}),t.jsxs("p",{style:{marginTop:12,display:"flex",gap:8,justifyContent:"center"},children:[t.jsx("button",{className:"btn pri",onClick:s,children:"Try again"}),r.home&&t.jsx("a",{className:"btn",href:"/",children:"Go to Home"})]})]})})}function xb({onClear:e}){return t.jsxs("span",{className:"note draftnote",children:["Kept as a draft on this computer."," ",t.jsx("button",{type:"button",className:"linkbtn",onClick:e,children:"Clear"})]})}function tn(e){return new Date(e).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1})}function Ls(e){return e?new Date(e).toLocaleDateString("en-GB",{day:"numeric",month:"short"}):""}function st(e){const n=Math.max(0,(Date.now()-Date.parse(e))/1e3);return n<60?"just now":n<3600?`${Math.round(n/60)} min ago`:n<86400?`${Math.round(n/3600)} h ago`:Ls(e)}function qj({text:e,dir:n}){const s=e.split(/(\*\*[^*]+\*\*)/g);return t.jsx(t.Fragment,{children:s.map((r,i)=>r.startsWith("**")?t.jsx("strong",{children:t.jsx(Jt,{text:r.slice(2,-2),dir:n})},i):t.jsx("span",{children:t.jsx(Jt,{text:r,dir:n})},i))})}function OS({notes:e}){return t.jsx("div",{className:"notes",children:e.split(`
648
+ `).map((n,s)=>{const{dir:r}=tt(n);return n.startsWith("### ")?t.jsx(R,{as:"h4",text:n.slice(4)},s):n.startsWith("- ")?t.jsxs("p",{dir:r,lang:r==="rtl"?"ar":"en",children:["• ",t.jsx(qj,{text:n.slice(2),dir:r})]},s):n.trim()?t.jsx("p",{dir:r,lang:r==="rtl"?"ar":"en",children:t.jsx(qj,{text:n,dir:r})},s):null})})}function g1(e){switch(e.waiting?.kind){case"questions":return`squad answer ${e.id}`;case"stuck":return`squad decide ${e.id}`;case"ask":return`squad reply ${e.id}`;case"yours":return e.takenOver?.free?`squad outside back ${e.id}`:`squad give-back ${e.id}`;case"chat":return`squad chat ${e.id}`;case"depends":return`squad build ${e.id} --on-branch`;case"split":return`squad split ${e.id}`;case"change":case"spec":case"plan":case"proof":return`squad approve ${e.id}`;default:return`squad watch ${e.id}`}}function x1(e){const n=e.outdated??[];return n.length===1?`${n[0].adr} came after this plan and changes it`:`${n.map(s=>s.adr).join(" and ")} came after this plan and change it`}function zd(e){switch(e.waiting?.kind){case"questions":return"Answer";case"spec":return"Review spec";case"plan":return e.specApproved?"Review design":"Review plan";case"proof":return"Check proof";case"stuck":return"Decide";case"ask":return"Answer";case"yours":return e.takenOver?.free?"Bring it back":"Give back";case"chat":return"Open chat";case"change":return"Review design update";case"depends":return"Choose";case"split":return"Decide the split";default:return"Open"}}const er={tickets:"Tickets",specs:"Specs",implement:"Implement",test:"Test",review:"Review",release:"Release",bugs:"Bugs",done:"Released"},yb=900;function De(){return ve({queryKey:["board"],queryFn:()=>ye("/api/v1/board"),refetchInterval:yb})}function qa(e){return ve({queryKey:["ticket",e],queryFn:()=>ye(`/api/v1/tickets/${e}`),enabled:!!e,refetchInterval:yb})}function _S(){return ve({queryKey:["releases"],queryFn:()=>ye("/api/v1/releases"),refetchInterval:2e3})}function gu(){return ve({queryKey:["apps"],queryFn:()=>ye("/api/v1/apps"),refetchInterval:e=>e.state.data?.apps.some(n=>n.state==="starting")||e.state.data?.reading?1e3:5e3})}function jb(){return ve({queryKey:["app","settings"],queryFn:()=>ye("/api/v1/app/settings"),refetchInterval:5e3})}function DS(){return ve({queryKey:["architecture"],queryFn:()=>ye("/api/v1/architecture"),refetchInterval:2e3})}function re(){const e=Ot(),{toast:n}=Le(),s=yl({mutationFn:({path:r,body:i,method:a="POST"})=>et(r,a,i),onSuccess:(r,i)=>{e.invalidateQueries(),i.after?.(r);const a=typeof i.done=="function"?i.done(r):i.done;a&&n(a)},onError:(r,i)=>n(r instanceof Error?r.message:String(r),"err",Ov(r)?()=>s.mutate(i):void 0)});return s}function kb(){const{toast:e}=Le(),[n,s]=N.useState(!1);return{restarting:n,restart:async()=>{s(!0),da(!0);const i=await fetch("/healthz").then(l=>l.json()).catch(()=>({startedAt:void 0}));try{await et("/api/v1/restart","POST")}catch(l){s(!1),da(!1),e(l instanceof Error?l.message:String(l),"err");return}const a=Date.now()+9e4;for(;Date.now()<a;){await new Promise(c=>setTimeout(c,1e3));const l=await fetch("/healthz").then(c=>c.json()).catch(()=>null);if(l?.startedAt&&l.startedAt!==i.startedAt){window.location.reload();return}}s(!1),da(!1),e("The board did not come back. Run squad console in your terminal.","err")}}}function BS(){const{restarting:e,restart:n}=kb();return t.jsxs("div",{className:"updatebar",role:"status",children:[t.jsx(xs,{size:15}),t.jsxs("span",{children:[t.jsx("b",{children:"squad-kit was updated."})," Restart the board to use the new version. Running work picks up where it stopped."]}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn sm pri",disabled:e,onClick:()=>void n(),children:e?"Restarting…":"Restart now"})]})}function WS(e,n){const s=e instanceof Error?e.message:String(e);return/^404\b/.test(s)?`There is no ticket ${n} on this board. It may have been deleted.`:/^409\b[^{]*\{"error":"(.*)"\}$/.exec(s)?.[1]??s}function US(e,n=/win/i.test(typeof navigator>"u"?"":navigator.platform)&&!/darwin/i.test(navigator.platform)){return n||/^sudo\b/.test(e)?e:`sudo ${e}`}const vb=["app","update"],xu=["waiting","installing","restarting"],HS=2*6e4;function yu(){const e=ve({queryKey:vb,queryFn:()=>ye("/api/v1/app/update"),refetchInterval:r=>xu.includes(r.state.data?.progress.state??"idle")?1e3:6e4}),n=N.useRef(null),s=e.data?.startedAt;return N.useEffect(()=>{s&&(n.current&&n.current!==s&&window.location.reload(),n.current??=s)},[s]),e}function $l(){const e=Ot(),{toast:n}=Le(),[s,r]=N.useState(!1);return{pending:s,call:async(a,l,c={})=>{r(!0);try{const u=await et(a,l,c);return e.setQueryData(vb,u),u}catch(u){return n(u instanceof Error?u.message:String(u),"err"),null}finally{r(!1)}}}}function ef(e=[]){const n=[...new Set(e.map(s=>s.ticket??`the Architect in ${s.project}`))];return n.length<=1?n[0]??"":n.length<=3?`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`:`${n.slice(0,2).join(", ")} and ${n.length-2} more`}function KS(e){const n=new Date(e),s=a=>a.toDateString(),r=new Date(Date.now()-864e5);return`${s(n)===s(new Date)?"Today":s(n)===s(r)?"Yesterday":n.toLocaleDateString("en-GB",{day:"numeric",month:"short"})} at ${tn(e)}`}function y1({text:e}){const{toast:n}=Le(),s=()=>{const r=navigator.clipboard?.writeText(e);if(!r)return n("Could not copy. Select the text instead.","err");r.then(()=>n("Command copied"),()=>n("Could not copy. Select the text instead.","err"))};return t.jsxs("div",{className:"upd-cmd",children:[t.jsxs("span",{className:"term",children:[t.jsx("b",{children:">_"}),t.jsx("span",{children:e})]}),t.jsxs("button",{className:"btn sm",onClick:s,children:[t.jsx(Mn,{size:13})," Copy"]})]})}const VS=3;function bb({s:e}){const n=e.releases?.length?e.releases:e.notes?.length?[{version:e.latest??e.current,lines:e.notes,url:e.notesUrl}]:[];if(!n.length)return null;if(n.length===1)return t.jsx("ul",{className:"upd-notes","aria-label":"What is new",children:n[0].lines.slice(0,3).map(i=>t.jsx("li",{children:i},i))});const s=n.slice(0,VS),r=n.length-s.length;return t.jsxs("div",{className:"upd-rels","aria-label":"What is new",children:[s.map(i=>t.jsxs("div",{className:"upd-rel",children:[t.jsx("a",{className:"upd-ver",href:i.url,target:"_blank",rel:"noreferrer",title:`What is new in ${i.version}`,children:i.version}),t.jsx("ul",{className:"upd-notes",children:i.lines.slice(0,3).map(a=>t.jsx("li",{children:a},a))})]},i.version)),r>0&&t.jsxs("a",{className:"upd-more",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:["And ",r," older ",r===1?"release":"releases"]})]})}function YS(e){const n=e.progress.state;return xu.includes(n)?`Updating to ${e.progress.to}`:n==="done"?`On ${e.current} now`:n==="failed"?"Update needs you":!e.newer||!e.latest||e.later===e.latest?null:`${e.latest} is ready`}function wb(){const{data:e}=yu();if(!e)return null;const n=e.progress.state;return xu.includes(n)?t.jsx(QS,{s:e}):n==="done"?t.jsx(ZS,{s:e}):n==="failed"?t.jsx(XS,{s:e}):!e.newer||!e.latest||e.later===e.latest?null:t.jsx(GS,{s:e})}function GS({s:e}){const{pending:n,call:s}=$l(),r=e.devInstall||e.major;return t.jsxs("section",{className:"upd","aria-label":"A new squad-kit",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(Zn,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsxs("b",{className:"upd-title",children:["squad-kit ",e.latest," is ready"]}),t.jsx(bb,{s:e}),t.jsx("span",{className:"upd-sub",children:e.devInstall?"This squad-kit runs from its source folder, so it does not update itself. To use the new version, run:":e.major?`A big change from ${e.current}. Read what is new first, then run this in a terminal:`:`You have ${e.current}. Takes about a minute. Your tickets and work are kept.`}),r&&t.jsx(y1,{text:e.command})]}),t.jsxs("div",{className:"upd-acts",children:[!r&&t.jsxs("button",{className:"btn sm pri",disabled:n,onClick:()=>void s("/api/v1/app/update","POST"),children:[t.jsx(Zn,{size:14})," Update now"]}),(!(e.notes?.length||e.releases?.length)||r)&&t.jsx("a",{className:"btn sm",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:"What is new"}),t.jsx("button",{className:"btn sm",disabled:n,onClick:()=>void s("/api/v1/app/update","PUT",{later:e.latest}),children:"Later"}),!r&&t.jsx(X,{text:"squad upgrade"})]})]})}function QS({s:e}){const n=e.progress;N.useEffect(()=>{if(n.state!=="restarting")return;da(!0);const h=window.setTimeout(()=>da(!1),HS);return()=>{window.clearTimeout(h),da(!1)}},[n.state]);const{pending:s,call:r}=$l(),i=xu.indexOf(n.state),a=h=>h<i?"done":h===i?"now":"todo",l=n.now?"Stopped the running steps":n.waitedFor?.length?`Waited for ${ef(n.waitedFor)} to finish ${n.waitedFor.length===1?"its step":"their steps"}`:"No work was in the middle of a step",c=n.busy?.length?`${ef(n.busy)} ${n.busy.length===1?"is":"are"} in the middle of a step`:"Almost there",u=[{label:i>0?l:"Waiting for running work to reach a safe point",note:i===0?c:n.now?"They pick up again after the restart":"Nothing was cut off"},{label:i>1?`Installed squad-kit ${n.to}`:`Installing squad-kit ${n.to}`,note:i===1?"Takes about a minute":i>1?"Done":"Next"},{label:"Restarting the app",note:i===2?"This page reloads on its own":"Same link, same tickets"},{label:"Picking up where each ticket was",note:"Nothing is lost"}];return t.jsxs("section",{className:"upd steps","aria-label":`Updating to squad-kit ${n.to}`,"aria-live":"polite",children:[t.jsxs("div",{className:"upd-head",children:[t.jsxs("b",{className:"upd-title",children:["Updating to squad-kit ",n.to]}),t.jsx("span",{className:"upd-sub",children:n.state==="waiting"?"squad-kit waits until no agent is in the middle of a step, so no work is cut off.":"Takes about a minute. Your tickets and work are kept."}),n.state==="waiting"&&t.jsxs("span",{className:"upd-acts",children:[t.jsx("button",{className:"btn sm pri",disabled:s,onClick:()=>void r("/api/v1/app/update","POST",{now:!0}),title:"Running steps stop now and pick up again after the restart",children:"Update now anyway"}),t.jsx("button",{className:"btn sm",disabled:s,onClick:()=>void r("/api/v1/app/update","DELETE"),children:"Not now"})]})]}),t.jsx("ol",{className:"setup-steps",children:u.map((h,m)=>t.jsxs("li",{className:a(m),children:[t.jsx("span",{className:"mark",children:a(m)==="done"?t.jsx(ce,{size:12,strokeWidth:3}):a(m)==="now"?t.jsx("span",{className:"live"}):null}),t.jsxs("span",{className:"txt",children:[t.jsx("b",{children:h.label}),t.jsx("small",{title:h.note,children:h.note})]})]},h.label))}),t.jsx("div",{className:"setup-bar","aria-hidden":!0,children:t.jsx("i",{})})]})}function ZS({s:e}){const{pending:n,call:s}=$l(),r=e.progress.carried??[];return t.jsxs("section",{className:"upd","aria-label":`You are on squad-kit ${e.current}`,children:[t.jsx("span",{className:"upd-ic ok",children:t.jsx(ce,{size:16,strokeWidth:2.6})}),t.jsxs("div",{className:"upd-main",children:[t.jsxs("b",{className:"upd-title",children:["You are on squad-kit ",e.current]}),t.jsx("span",{className:"upd-sub",children:r.length?`${ef(r)} carried on where ${r.length===1?"it was":"they were"}. Nothing was lost.`:"Your tickets and work are kept."}),t.jsx(bb,{s:e})]}),t.jsxs("div",{className:"upd-acts",children:[t.jsx("a",{className:"btn sm",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:"Read what is new"}),t.jsx("button",{className:"btn sm",disabled:n,onClick:()=>void s("/api/v1/app/update","DELETE"),children:"Close"})]})]})}function XS({s:e}){const n=e.progress,{pending:s,call:r}=$l();return t.jsxs("section",{className:"upd failed",role:"alert","aria-label":"squad-kit could not update by itself",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(Jv,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsx("b",{className:"upd-title",children:"Could not update by itself"}),t.jsxs("span",{className:"upd-sub",children:[n.reason," ",n.permission?"Run this once in a terminal, then press Restart:":"Try again, or run this in a terminal, then press Restart:"]}),t.jsx(y1,{text:n.permission?US(e.command):e.command}),n.output&&t.jsxs("details",{className:"upd-out",children:[t.jsx("summary",{children:"What the installer said"}),t.jsx("pre",{children:n.output})]})]}),t.jsxs("div",{className:"upd-acts",children:[t.jsxs("button",{className:"btn sm pri",disabled:s,onClick:()=>void r("/api/v1/app/update/restart","POST"),children:[t.jsx(xs,{size:14})," Restart"]}),!n.permission&&t.jsx("button",{className:"btn sm",disabled:s,onClick:()=>void r("/api/v1/app/update","POST"),children:"Try again"}),t.jsx("button",{className:"btn sm",disabled:s,onClick:()=>void r("/api/v1/app/update","DELETE"),children:"Not now"})]})]})}function Nb(){const{data:e}=yu(),{pending:n,call:s}=$l(),{toast:r}=Le();if(!e)return null;const i=async()=>{const l=await s("/api/v1/app/update/check","POST");l&&(l.checkError?r(l.checkError,"err"):r(l.newer?`squad-kit ${l.latest} is ready`:`You are on the latest version (${l.current})`))},a=e.newer&&!e.devInstall&&!e.major&&e.progress.state==="idle";return t.jsxs("div",{className:"about",children:[t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Version"}),t.jsxs("span",{className:"about-row",children:[t.jsx("b",{children:e.current}),e.newer?t.jsxs("span",{className:"pill you",children:[e.latest," is ready"]}):e.checkedAt&&!e.checkError?t.jsx("span",{className:"pill ok",children:"Up to date"}):null,e.devInstall&&t.jsx("span",{className:"pill",children:"Source folder"})]})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Last checked"}),t.jsxs("span",{className:"about-row",children:[e.checkedAt?KS(e.checkedAt):"Not yet",e.checkError&&t.jsx("span",{className:"note bad",children:e.checkError})]})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Updates"}),t.jsxs("span",{className:"about-row",children:[t.jsxs("label",{className:"about-daily",children:[t.jsx("input",{type:"checkbox",checked:e.daily,disabled:n,onChange:l=>void s("/api/v1/app/update","PUT",{daily:l.target.checked})}),"Check for updates every day"]}),t.jsx("span",{className:"note",children:"Turn it off on a network without internet."})]})]}),t.jsxs("div",{className:"about-acts",children:[t.jsx("button",{className:"btn sm",disabled:n,onClick:()=>void i(),children:n?"Checking…":"Check for updates"}),t.jsx("a",{className:"btn sm",href:e.notesUrl,target:"_blank",rel:"noreferrer",children:"Release notes"}),a&&t.jsxs("button",{className:"btn sm pri",disabled:n,onClick:()=>void s("/api/v1/app/update","POST"),children:[t.jsx(Zn,{size:14})," Update to ",e.latest]}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:"squad upgrade"})]}),e.newer&&(e.devInstall||e.major)&&t.jsx(y1,{text:e.command})]})}function JS(){const{data:e}=yu(),[n,s]=N.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn sm",onClick:()=>s(!0),title:"Version and updates",children:[e?`squad-kit ${e.current}`:"About",e?.newer&&t.jsx("span",{className:"about-dot","aria-label":`${e.latest} is ready`})]}),n&&t.jsx(Ye,{title:"About squad-kit",onClose:()=>s(!1),children:t.jsx(Nb,{})})]})}const Sb="squad-kit-first-start-lang";function Br(){try{const e=localStorage.getItem(Sb);if(e==="ar"||e==="en")return e}catch{}return typeof navigator<"u"&&navigator.language?.toLowerCase().startsWith("ar")?"ar":"en"}function eC(e){try{localStorage.setItem(Sb,e)}catch{}}function Cb(e){try{return localStorage.getItem(e)==="1"}catch{return!1}}function $b(e){try{localStorage.setItem(e,"1")}catch{}}const Tb=e=>!!e.mergedAt||e.stage==="release"||e.stage==="done";function tC(e,n){return[...e,...n].some(Tb)?null:e.find(s=>s.track!=="auto"&&!s.takenOver?.free)??null}function nC(e){const n=e.waiting?.kind;return n==="proof"?3:n==="spec"||n==="plan"?1:e.stage==="tickets"||n==="questions"?0:e.stage==="specs"?1:2}function sC(e){const n=e.waiting?.kind;return n?n==="questions"?"questions":n==="spec"||n==="plan"||n==="proof"?n:"other":"working"}const rC=1440*60*1e3;function iC(e,n,s=Date.now()){const r=[...e,...n].filter(Tb);if(r.length!==1)return null;const i=r[0],a=Date.parse(i.mergedAt??"");return a&&s-a<rC?i:null}function Vp(e,n,s,r){return e===1?n:e===2?s:`${e} ${e<=10?r:n}`}function aC(e){const n=Date.parse(e.createdAt),s=Date.parse(e.mergedAt??""),r=n&&s?Math.max(1,Math.round((s-n)/6e4)):1,i=e.gates?.proof==="pass"?e.criteria?.length:void 0,a=(e.gates?.ran??[]).reduce((c,u)=>c+(u.ok?u.tests??0:0),0),l=(e.usage??[]).reduce((c,u)=>c+(u.costUsd??0),0);return{minutes:r,...i?{doneWhen:i}:{},...a?{tests:a}:{},...l?{costUsd:l}:{}}}const oC={en:{title:"Your first story",hide:"Hide this",open:"Open it",items:["Answer the Analyst","Approve what gets built","Your squad builds it","Check the proof and say Looks right"],hints:{questions:{head:"Your turn: answer the questions",body:"The Analyst asks only what your story leaves open. Your answers shape the story."},spec:{head:"Your turn: approve the spec",body:"This is what the squad will build, in plain words. Nothing is built until you approve it."},plan:{head:"Your turn: approve the plan",body:"This is how the squad will build it. Nothing is built until you approve it."},proof:{head:"Your turn: check the proof",body:'Each "done when" shows pictures of the real app. Look at them, or press Try it yourself to use it. Nothing is merged until you say so.'},other:{head:"Your turn",body:"The squad needs a word from you. Open the story to see what."},working:{head:"Your squad is working",body:"You can close this and come back. You get a card when the squad needs you, and you can ask a question at any time."}}},ar:{title:"قصتك الأولى",hide:"إخفاء",open:"افتحها",items:["أجب عن أسئلة المحلل","وافق على ما سيُبنى","فريقك يبنيها","راجع الدليل وقل: يبدو صحيحًا"],hints:{questions:{head:"دورك: أجب عن الأسئلة",body:"لا يسأل المحلل إلا عمّا تركته قصتك مفتوحًا، وإجاباتك تحدد شكلها."},spec:{head:"دورك: وافق على المواصفات",body:"هذا ما سيبنيه الفريق بكلمات واضحة، ولن يُبنى شيء حتى توافق."},plan:{head:"دورك: وافق على الخطة",body:"هكذا سيبنيه الفريق، ولن يُبنى شيء حتى توافق."},proof:{head:"دورك: راجع الدليل",body:"كل شرط إنجاز يعرض صورًا من التطبيق الحقيقي. انظر إليها، أو جرّب التطبيق بنفسك. لا يُدمج شيء حتى تقول ذلك."},other:{head:"دورك",body:"يحتاج الفريق إلى كلمة منك. افتح القصة لتعرف ما هي."},working:{head:"فريقك يعمل",body:"يمكنك إغلاق هذا والعودة لاحقًا. ستصلك بطاقة عندما يحتاجك الفريق، ويمكنك طرح سؤال في أي وقت."}}}};function lC({tickets:e,archived:n,live:s,project:r,onOpen:i}){const a=`squad-kit-first-story-hidden:${r}`,[l,c]=N.useState(()=>Cb(a)),u=Br(),h=s&&!l?tC(e,n):null;if(!h)return null;const m=oC[u],p=nC(h),x=sC(h),g=m.hints[x];return t.jsxs("section",{className:"fs",dir:u==="ar"?"rtl":"ltr",lang:u,"aria-label":m.title,children:[t.jsxs("div",{className:`fs-hint ${x==="working"?"":"fs-hint-you"}`,children:[t.jsx("b",{children:g.head}),t.jsx("span",{children:g.body}),t.jsxs("div",{className:"fs-acts",children:[t.jsx("button",{className:"btn sm pri",onClick:()=>i(h.id),children:m.open}),t.jsx(R,{className:"note",text:h.title})]})]}),t.jsxs("div",{className:"fs-list",children:[t.jsx("b",{children:m.title}),m.items.map((j,k)=>t.jsxs("div",{className:`fs-item ${k===p?"fs-item-now":""}`,children:[t.jsx("span",{className:`fs-dot ${k<p?"fs-dot-done":""}`,children:k<p&&t.jsx(ce,{size:11,strokeWidth:3,role:"img","aria-label":"Done"})}),t.jsx("span",{children:j})]},j))]}),t.jsx("button",{className:"iconbtn","aria-label":m.hide,title:m.hide,onClick:()=>{$b(a),c(!0)},children:t.jsx(Ue,{size:15})})]})}const cC={en:{head:"Your first story is in.",sub:()=>['"','" now works in your app. Here is what your squad did.'],took:"from your idea to working",doneWhen:'"done when" checked',tests:"automatic tests pass",cost:"of AI use",next:"Write your next story",app:"Open your app",pr:"Send it as a pull request",close:"Close",of:"of",time:e=>e<60?`${e} min`:e<2880?`${Math.round(e/60)} h`:`${Math.round(e/1440)} days`},ar:{head:"قصتك الأولى اكتملت.",sub:()=>["«","» تعمل الآن في تطبيقك. هذا ما فعله فريقك."],took:"من فكرتك إلى برنامج يعمل",doneWhen:"شروط الإنجاز التي تم التحقق منها",tests:"اختبارات آلية ناجحة",cost:"من استخدام الذكاء الاصطناعي",next:"اكتب قصتك التالية",app:"افتح تطبيقك",pr:"أرسلها كطلب دمج",close:"إغلاق",of:"من",time:e=>e<60?Vp(e,"دقيقة","دقيقتان","دقائق"):e<2880?Vp(Math.round(e/60),"ساعة","ساعتان","ساعات"):Vp(Math.round(e/1440),"يوم","يومان","أيام")}};function dC(){const e=De(),n=e.data?.ready?e.data:null,s=n?`squad-kit-first-win:${n.meta.project}`:"",[r,i]=N.useState(!1),a=n&&n.meta.engine==="live"&&!r&&!Cb(s)?iC(n.tickets,n.archived??[]):null;return a?t.jsx(uC,{t:a,self:!!n?.self,onClose:()=>{$b(s),i(!0)}}):null}function uC({t:e,self:n,onClose:s}){const r=_t(),i=gu(),a=re(),l=Br(),c=cC[l],u=aC(e),h=i.data?.apps?.find(j=>j.start),m=N.useRef(null);N.useEffect(()=>m.current?.focus(),[]),N.useEffect(()=>{const j=k=>{k.key==="Escape"&&s()};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[s]);const[p,x]=c.sub(e.title),g=[{value:c.time(u.minutes),label:c.took},...u.doneWhen?[{value:`${u.doneWhen} ${c.of} ${u.doneWhen}`,label:c.doneWhen}]:[],...u.tests?[{value:String(u.tests),label:c.tests}]:[],...u.costUsd?[{value:`$${u.costUsd.toFixed(2)}`,label:c.cost}]:[]];return t.jsx("div",{className:"wl fw",dir:l==="ar"?"rtl":"ltr",lang:l,role:"dialog","aria-modal":"true","aria-label":c.head,children:t.jsxs("div",{className:"wl-in",children:[t.jsxs("div",{className:"wl-top",children:[t.jsxs("div",{className:"wl-logo",dir:"ltr",children:[t.jsx("img",{src:"/logo.svg",alt:""}),t.jsx("span",{children:"squad-kit"})]}),t.jsx("button",{className:"iconbtn","aria-label":c.close,onClick:s,children:t.jsx(Ue,{size:18})})]}),t.jsxs("div",{className:"wl-main",style:{maxWidth:900},children:[t.jsx(K9,{className:"fw-mark",size:64,strokeWidth:1.75,"aria-hidden":"true"}),t.jsx("h1",{className:"fw-h",children:c.head}),t.jsxs("p",{className:"fw-sub",children:[p,t.jsx(R,{text:e.title}),x]}),t.jsx("div",{className:"fw-stats",children:g.map((j,k)=>t.jsxs("div",{className:"fw-stat",style:{"--d":`${.2+k*.12}s`},children:[t.jsx("b",{children:j.value}),t.jsx("span",{children:j.label})]},j.label))}),t.jsxs("div",{className:"fw-acts",children:[n&&t.jsx("button",{ref:m,className:"wl-cta",onClick:()=>{s(),r({to:"/board",search:{ticket:e.id}})},children:c.pr}),t.jsx("button",{ref:n?void 0:m,className:n?"fw-ghost":"wl-cta",onClick:()=>{s(),r({to:"/board",search:{write:1}})},children:c.next}),h&&t.jsx("button",{className:"fw-ghost",disabled:a.isPending,onClick:()=>{a.mutate({path:`/api/v1/apps/${encodeURIComponent(h.name)}/start`,done:`Starting ${h.name}`}),s()},children:c.app})]})]})]})})}function Si(e){const n=e.changes?.at(-1);return n&&n.status!=="done"&&n.status!=="declined"?n:void 0}function Xs(e){const n=Si(e)?.status;return n==="proposed"||n==="failed"||n==="design-ready"}function ju(e){return e.now?.merging?!1:!!(e.waiting||e.quiet?.kind==="stuck"||e.outdated?.length||Xs(e)||Rs(e))}function Eb(e,n){return e.filter(ju).length+n}function Rs(e){return!!e.testChange?.ask}function j1(e){return Rs(e)?"squad-kit cannot tell which way of testing to keep":""}function hC(e,n){return n>0?`(${n}) ${e}`:e}function pC(e,n){const s=Math.max(0,(n-Date.parse(e))/1e3);if(!Number.isFinite(s)||s<60)return"just now";if(s<3600)return`waiting ${Math.round(s/60)} min`;if(s<86400)return`waiting ${Math.round(s/3600)} h`;const r=Math.round(s/86400);return`waiting ${r} ${r===1?"day":"days"}`}function Ab(e){return!e.waiting&&e.quiet?.kind==="stuck"?e.quiet.since:e.activity[0]?.at??e.createdAt}class mC{rank=new Map;next=0;sort(n){const s=n.filter(i=>!this.rank.has(i.key)).sort((i,a)=>i.since.localeCompare(a.since)||i.key.localeCompare(a.key));for(const i of s)this.rank.set(i.key,this.next++);const r=new Set(n.map(i=>i.key));for(const i of this.rank.keys())r.has(i)||this.rank.delete(i);return[...n].sort((i,a)=>this.rank.get(i.key)-this.rank.get(a.key))}}function fC(e){const n=new Set;return e.waiting&&n.add(e.waiting.kind),Xs(e)&&n.add("change"),e.quiet?.kind==="stuck"&&n.add("quiet"),e.outdated?.length&&n.add("outdated"),Rs(e)&&e.waiting?.kind!=="plan"&&n.add("test-command"),[...n]}const gC=["yours","chat","release"];function xC(e){return!gC.includes(e)}function yC(e,n,s){const r=Si(n),i=s==="ask"?n.agentQuestion?.at:s==="change"&&r?`${r.id}-${r.status==="design-ready"?"design":"spec"}`:s==="quiet"?n.quiet?.since:s==="outdated"?n.outdated?.map(a=>a.adr).join("+"):s==="test-command"?n.testChange?.to:void 0;return`${e}/${n.id}/${s}${i?`/${i}`:""}`}function jC(e){return e.flatMap(({project:n,ticket:s})=>fC(s).filter(xC).map(r=>({key:yC(n.id,s,r),project:n,ticket:s,reason:r})))}const Md=2*6e4;class kC{known=null;gone=new Map;next(n,s){const r=new Set(n.map(l=>l.key));if(!this.known)return this.known=r,[];const i=this.known,a=n.filter(l=>!i.has(l.key)&&!(s-(this.gone.get(l.key)??-1/0)<Md));for(const l of i)r.has(l)||this.gone.set(l,s);for(const[l,c]of this.gone)(r.has(l)||s-c>=Md)&&this.gone.delete(l);return this.known=r,a}}const Ij="sk.notices.shown";function Pb(e,n,s){if(!s)return!0;let r={};try{r=JSON.parse(s.getItem(Ij)??"{}")}catch{r={}}if(n-(r[e]??-1/0)<Md)return!1;const i=Object.fromEntries(Object.entries(r).filter(([,a])=>n-a<Md));i[e]=n;try{s.setItem(Ij,JSON.stringify(i))}catch{}return!0}const vC={analyst:"Analyst",architect:"Architect",builder:"Builder",reviewer:"Reviewer",tester:"Tester"};function bC(e){const n=e.ticket,s={questions:"the squad has questions for you",ask:`the ${vC[n.agentQuestion?.from??""]??"squad"} has a question`,spec:"the spec is ready for you",plan:n.specApproved?"the design is ready for you":"the plan is ready for you",change:"a change waits for you",depends:"it needs a ticket that is not merged yet",split:"the Analyst suggests a split",proof:"the proof is ready to check",stuck:"the squad stopped and needs you",quiet:"a step looks stuck",outdated:"a newer decision changes the plan","test-command":"a choice about the tests waits for you",yours:"you took it over",chat:"your talk with the squad",release:"ready to release"};return{title:`${n.id}: ${s[e.reason]}`,body:`${n.title} · ${e.project.name}`}}function Rb(e,n){const s=`/p/${encodeURIComponent(e)}`;return n.waiting?.kind==="proof"?`${s}/tickets/${encodeURIComponent(n.id)}/proof`:`${s}/board?ticket=${encodeURIComponent(n.id)}`}const wC=8e3;function NC(e,n){return e?n.secure?e.permission==="granted"||e.permission==="denied"?Promise.resolve(e.permission):new Promise(s=>{let r=!1;const i=c=>{r||(r=!0,clearTimeout(l),s(c))},a=c=>i(c==="granted"||c==="denied"||c==="default"?c:e.permission==="default"?"default":e.permission),l=setTimeout(()=>i(e.permission==="default"?"timeout":e.permission),n.timeoutMs??wC);try{const c=e.requestPermission(a);c&&typeof c.then=="function"&&c.then(a,()=>i(e.permission==="default"?"error":e.permission))}catch{i(e.permission==="default"?"error":e.permission)}}):Promise.resolve("insecure"):Promise.resolve("unsupported")}const Mo="Allow notifications for this page in your browser's site settings (the icon next to the address), then reload. On a Mac, also check System Settings › Notifications for your browser.";function SC(e){switch(e){case"granted":return{choice:"on",test:!0,bad:!1,say:"Desktop notices are on. Didn't see one just now? Your computer may block notices for this browser: check the system's notification settings."};case"denied":return{choice:"on",test:!1,bad:!0,say:`Your browser blocks notices from this page. ${Mo}`};case"timeout":return{choice:"on",test:!1,bad:!0,say:`Your browser has not answered. ${Mo} Notices start once it allows them.`};case"error":return{choice:"on",test:!1,bad:!0,say:`Your browser did not let this page ask. ${Mo}`};case"insecure":return{choice:null,test:!1,bad:!0,say:"Your browser shows desktop notices only on a secure page. Open the board on this computer, at its 127.0.0.1 or localhost address, to turn them on."};case"unsupported":return{choice:null,test:!1,bad:!0,say:"This browser can't show desktop notices. The banner and the tab title still show what needs you."};default:return{choice:"off",test:!1,bad:!1,say:"No desktop notices for now. Turn them on in Settings any time."}}}const qb="Your browser is asking: look near the address bar.";function CC(e,n){const s=e.filter(u=>u.kind==="tests"),r=e.filter(u=>u.kind!=="tests"),i=new Set(r.map(u=>u.id)),a=n.filter(u=>i.has(u.from)&&i.has(u.to)&&u.from!==u.to),l=new Map(r.map(u=>[u.id,0]));for(let u=0;u<r.length;u+=1){let h=!1;for(const m of a){const p=l.get(m.from)+1;p>l.get(m.to)&&p<r.length&&(l.set(m.to,p),h=!0)}if(!h)break}const c=[];for(const u of r)(c[l.get(u.id)]??=[]).push(u);return{columns:c.filter(Boolean),below:s}}function $C(e,n,s){return s.filter(r=>r.from===e.id).map(r=>`${r.label??"uses"} ${n.find(i=>i.id===r.to)?.name??r.to}`).join(" · ")}function tf(e,n){if(e.state==="now"&&e.since){const s=Math.max(0,Math.floor((n-Date.parse(e.since))/1e3));return`${Math.floor(s/60)}:${String(s%60).padStart(2,"0")}`}return e.state==="todo"||e.state==="skipped"||e.seconds===void 0?"":e.seconds<60?`${Math.max(1,e.seconds)} s`:`${Math.round(e.seconds/60)} min`}const Ib="sk.notices.setup";function rl(e){try{const n=JSON.parse(e?.getItem(Ib)??"[]");return Array.isArray(n)?n.filter(s=>typeof s=="string"):[]}catch{return[]}}function Fb(e,n){try{e?.setItem(Ib,JSON.stringify([...new Set(n)]))}catch{}}function TC(e,n){Fb(e,[...rl(e),n])}function EC(e,n){Fb(e,rl(e).filter(s=>s!==n))}function AC(e,n){return e.filter(s=>n.includes(s.id)&&s.setup?.ready&&!s.setup.approved)}function PC(e){return{title:`${e} is ready`,body:"squad-kit has read your project. Check what it understood, then start."}}function Lb(e,n){return(e??[]).filter(s=>s.repo===n&&!s.shared).map(s=>s.name)}function Me(e){return/["$`\\!]/.test(e)?`'${e.replace(/'/g,"'\\''")}'`:`"${e}"`}function Ci(e){return/^[\w@%+=:,./#-]+$/.test(e)&&!e.startsWith("#")?e:Me(e)}function zb(e){let n;do n=e,e=e.replace(/<!--[\s\S]*?-->/g,"");while(e!==n);return e}const Fj="Skip: let the Analyst decide",RC={reading:"Analyst reading",questions:"Questions for you",drafting:"Analyst writing the breakdown",ready:"Ready for you to approve",approved:"Approved",failed:"Stopped"},qC={reading:"ok",questions:"you",drafting:"ok",ready:"you",approved:"ok",failed:"bug"};function Mb(e){if(e.status!=="approved")return{text:RC[e.status],tone:qC[e.status]};if(e.counts.stories>0&&e.counts.merged===e.counts.stories)return{text:"Built",tone:"ok"};const n=e.state?.build;return n?.on?{text:"Building continuously",tone:"ok"}:n?{text:"Paused",tone:"plain"}:e.building?{text:"Building",tone:"ok"}:{text:"Approved",tone:"ok"}}function IC(e){return Mb({status:e.status,counts:e.counts,building:e.building})}function en(e,n,s=`${n}s`){return`${e} ${e===1?n:s}`}function FC(e){return`${en(e.epics,"epic")}, ${en(e.features,"feature")}, ${en(e.stories,"story","stories")}`}function LC(e){if(e<90)return`${Math.max(1,Math.round(e))} min`;const n=Math.round(e/30)/2;return`${n} ${n===1?"hour":"hours"}`}function zC(e){return e>0&&e<1?"under $1":`$${Math.round(e)}`}function Ob(e){return e.rough?"a rough guess: no finished tickets yet":`based on ${en(e.basedOn,"finished ticket")}`}function k1(e){return{...e.costUsd!==void 0?{cost:zC(e.costUsd)}:{},time:LC(e.minutes)}}function MC(e){if(!e.stories)return"Every story is merged.";const{cost:n,time:s}=k1(e);return`${en(e.stories,"story","stories")}, about ${n?`${n} and `:""}${s}, ${e.parallel} at a time, ${Ob(e)}`}function OC(e){if(!e.stories)return"Every story is merged";const{cost:n,time:s}=k1(e);return`About ${s}${n?` and ${n}`:""} left`}function $i(e){return!!(e&&(e.status==="pending"||e.status==="running"||e.status==="stopping"))}const _b=e=>e.charAt(0).toUpperCase()+e.slice(1);function _C(e){return e?`${_b(e.unit)} ${Math.max(1,Math.min(e.done,e.of||e.done))} of ${e.of}`:""}function Yp(e){if(!e||!e.epics&&!e.features&&!e.stories)return"";const n=[en(e.epics,"epic"),en(e.features,"feature"),...e.stories?[en(e.stories,"story","stories")]:[]];return`Found ${n.length===3?`${n[0]}, ${n[1]} and ${n[2]}`:n.join(" and ")} so far.`}function Lj(e){return e<60?"less than a minute":`${Math.round(e/60)} min`}function DC(e,n=Date.now()){if(!e)return"";const s=e.startedAt?Math.max(0,(n-Date.parse(e.startedAt))/1e3):null,r=e.usualSeconds?`usually about ${Lj(e.usualSeconds)}${e.at?.of?` for ${en(e.at.of,e.at.unit)}`:""}`:"";return[s!==null?`${Lj(s)} so far`:"",r].filter(Boolean).join(", ")}function BC(e){const n=e.source,s=n.pictures?`, tables and ${en(n.pictures,"picture")}, so the Analyst sees the mockups too`:" and tables";return n.kind==="docx"?{title:"Turned the Word file into text",sub:`Kept the headings${s}.`}:n.kind==="pdf"?{title:"Kept the PDF as it is",sub:`The Analyst reads ${n.pages?`its ${en(n.pages,"page")}`:"it"} directly, pictures and all.`}:n.kind==="pasted"?{title:"Saved the pasted text",sub:n.pages&&n.pages>1?`In ${n.pages} parts, so the Analyst reads it part by part.`:"The Analyst reads it as you pasted it."}:{title:"Saved the text",sub:n.pages&&n.pages>1?`In ${n.pages} parts, so the Analyst reads it part by part.`:"The Analyst reads it as it is."}}function WC(e){const n=e.state.job,s=n?.step,r=e.status==="failed",i=["text","read","questions","draft"],a=e.status==="questions"?"questions":e.status==="drafting"||s==="draft"?"draft":s==="text"?"text":e.status==="ready"||e.status==="approved"?"draft":"read",l=i.indexOf(a),c=e.status==="ready"||e.status==="approved",u=x=>{const g=i.indexOf(x);return c||g<l?"done":g>l?"todo":r?"failed":"now"},h=a==="read"&&n?[_C(n.at),Yp(n.found)].filter(Boolean):[],m=n?.status==="pending"&&n.now?n.now:"",p=e.questions.length;return[{key:"text",...BC(e),state:u("text")},{key:"read",title:"Reading the document",sub:u("read")==="now"?m&&!n?.at?.done?`${m}.`:h.length?`${h[0]}${h[1]?`. ${h[1]}`:"."}`:"Starting to read.":u("read")==="failed"?"It stopped here. Nothing it found is lost.":u("read")==="done"?"Read the whole document.":"Page by page, writing down the epics and features it finds.",state:u("read"),...a==="read"&&n?.at?.of?{bar:{done:n.at.done,of:n.at.of}}:{}},{key:"questions",title:"Questions for you",sub:u("questions")==="done"&&l>2?p?`${en(p,"question")}, answered.`:"None: the BRD was clear.":"Only when something is missing or two parts clash. Small things it decides and writes down.",state:u("questions")},{key:"draft",title:"Writing the epics, features and stories",sub:u("draft")==="now"&&n?.now?`${n.now}.${Yp(n.found)?` ${Yp(n.found)}`:""}`:'Each story gets "done when" checks, its size, what it needs first, and where it comes from in the BRD.',state:u("draft")}]}function Tl(e){return e?[[e.section,e.title].filter(Boolean).join(" "),e.page?`page ${e.page}`:""].filter(Boolean).join(", "):""}function UC(e){return/^\d/.test(e.trim())?`From section ${e.trim()}`:`From ${e.trim()}`}function HC(e){return[e.section??e.title,e.page?`page ${e.page}`:""].filter(Boolean).join(", ")}function El(e){return e.epics.flatMap(n=>[...n.features.flatMap(s=>s.stories.map(r=>({story:r,epic:n,feature:s}))),...n.stories.map(s=>({story:s,epic:n}))])}function ts(e,n){if(!n)return null;for(const s of e.epics){if(s.key===n)return{level:"epic",item:s,epic:s};for(const i of s.features){if(i.key===n)return{level:"feature",item:i,epic:s,feature:i};const a=i.stories.find(l=>l.key===n);if(a)return{level:"story",item:a,epic:s,feature:i,story:a}}const r=s.stories.find(i=>i.key===n);if(r)return{level:"story",item:r,epic:s,story:r}}return null}function Ti(e){return"features"in e?[...e.features.flatMap(n=>n.stories),...e.stories]:e.stories}function KC(e){return e.level==="epic"?"":[e.epic.title,e.level==="story"?e.feature?.title:void 0].filter(Boolean).join(" › ")}function Db(e){const n=en(Ti(e).length,"story","stories");return"features"in e&&e.features.length?`${en(e.features.length,"feature")}, ${n}`:n}function VC(e,n){return n.level==="epic"?[]:n.level==="feature"?e.epics.map(s=>({key:s.key,label:`${s.key} ${s.title}`})):e.epics.flatMap(s=>[...s.features.map(r=>({key:r.key,label:`${s.title} › ${r.title}`})),{key:s.key,label:`${s.title}, straight under the epic`}])}function YC(e){if(e.level!=="epic")return e.level==="feature"?e.epic.key:e.feature?.key??e.epic.key}const GC=["merged","released"];function ku(e){return!!(e&&GC.includes(e))}function Od(e,n){return{done:e.filter(s=>ku(n.get(s.key)?.state)).length,of:e.length}}function QC(e){const n=Math.max(0,e.stories-e.merged-e.building-e.needsYou);return{merged:e.merged,building:e.building,needsYou:e.needsYou,rest:n}}function zj(e,n){const s=new Map(e.progress.map(r=>[r.key,r]));return El(e).filter(({story:r})=>r.dependsOn.includes(n)&&!ku(s.get(r.key)?.state)).map(({story:r})=>r.key)}function ZC(e,n){const s=new Map(e.progress.map(r=>[r.key,r]));return n.dependsOn.filter(r=>!ku(s.get(r)?.state))}function Bb(e){return e==="clash"?"Two parts clash":e==="gap"?"Missing in the BRD":e==="check"?"A check failed":"Needs you"}function Wb(e){const n=/^(.+?[.?!])(\s|$)/.exec(e.trim());return(n?n[1]:e).trim()}function Mj(e,n){const s=new Set,r=new Map(e.progress.map(c=>[c.key,c.state])),i=["building","needs-you","next","waits"],a=e.progress.some(c=>i.includes(c.state)),l=ts(e,n);return e.epics.forEach((c,u)=>{const h=l?.epic.key===c.key,m=Ti(c).some(p=>i.includes(r.get(p.key)));(h||(a?m:u===0))&&s.add(c.key);for(const p of c.features){const x=p.stories.some(g=>i.includes(r.get(g.key)));(l?.feature?.key===p.key||l?.item.key===p.key||(a?x:u===0))&&s.add(p.key)}}),s}const XC={analyst:"Analyst",architect:"Architect",builder:"Builder",tester:"Tester",reviewer:"Reviewer",answer:"from your answer"};function Oj(e){return[e.item,e.ticket,XC[e.by]??e.by].filter(Boolean).join(" · ")}function Gp(e){const n=e.trim().split(/\s+/),s=n.pop()??"",r=/[^aeiou]y$/i.test(s)?`${s.slice(0,-1)}ies`:/s$/i.test(s)?s:`${s}s`;return[...n,r].map((a,l)=>l===0?_b(a.toLowerCase()):a.toLowerCase()).join(" ")}function Qp(e,n){if(n||e.new===e.all&&e.all>0)return"new";const s=[e.new?`${e.new} new`:"",e.changed?`${e.changed} changed`:""].filter(Boolean);return s.length?s.join(", "):"no changes"}function JC(e){const n=El(e).find(({story:s})=>s.dependsOn.length);return n?`${n.story.key} needs ${n.story.dependsOn[0]}`:null}function nf(e,n){if(!e)return{phase:"unknown",of:0,pct:0};const s=(h,m)=>m>0?Math.min(100,Math.round(h/m*100)):5,r=n&&(!n.at||!e.at||n.at===e.at)?n:null,i=e.links,a=e.items?.of??r?.items??(i?e.of:void 0);if(a===void 0)return{phase:"unknown",of:e.of,pct:s(e.done,e.of)};const l=e.items?.done??Math.min(e.done,a),c=i?.of??r?.links??0,u=e.items||i?s(l+(i?.done??0),a+(i?.of??0)):s(e.done,e.of);return l>=a&&c>0?{phase:"links",...i?{done:i.done}:{},of:c,pct:u}:{phase:"items",done:l,of:a,pct:u}}function Ub(e){return e.phase==="links"?e.done===void 0?`adding the ${en(e.of,"link")}`:`adding the links, ${e.done} of ${e.of}`:e.phase==="items"?`${e.done} of ${en(e.of,"item")}`:""}function e$(e){const n=e.counts.stories;if(!n||e.counts.merged<n)return null;const s=n===1?"The story is merged":`All ${n} stories are merged`;return e.progress.length>0&&e.progress.every(i=>i.state==="released")?{text:`${s} and went out in a release.`,release:!1}:{text:`${s} and ${n===1?"waits":"wait"} in the next release.`,release:!0}}function Hb(e,n){return n?/^c\d+$/.test(n)?`It became a small change on ${e}. The Analyst writes it into the spec.`:`${e} is merged, so it became a new ticket, ${n}, linked to it.`:`Changed on ${e}.`}function t$(e,n){const s=e.trim(),r=n.trim().replace(/[.!]$/,"").toLowerCase();return!r||!s.toLowerCase().startsWith(r)?s:s.slice(r.length).replace(/^[.!]?\s*/,"")||s}const sf=e=>!e.trim();function Zp(e){const n=[e.given,e.when,e.then];return n.some(sf)&&!n.every(sf)}function _j(e){return e.filter(n=>![n.given,n.when,n.then].every(sf))}function Dj(e){return`Add the part that was left out: ${e.text}${e.ref?` (${Tl(e.ref)})`:""}.`}function n$(e,n){const s=r=>!n||r.owner.trim().toLowerCase()===n.trim().toLowerCase();return e.filter(s).reduce((r,i)=>r+(i.status==="questions"?1:0)+i.counts.needsYou,0)}const Ys={col:172,gap:14,epicGap:44,pad:24,epicH:74,featY:160,featH:72,storyY:258,storyH:44,storyStep:50,popW:300,popH:150,rowWidth:1600};function s$(e,n=Ys.rowWidth){const{col:s,gap:r,epicGap:i,pad:a,epicH:l,featY:c,featH:u,storyY:h,storyH:m,storyStep:p}=Ys,x=new Map(e.progress.map($=>[$.key,$])),g=[],j=[],k=l+(c-l)/2;let b=a,w=0,S=a,T=a+c+u,E=a*2+s;const z=($,P,L)=>{$.forEach((W,F)=>{g.push({key:W.key,level:"story",row:w,x:P,y:L+F*p,w:s,h:m,title:W.title,state:x.get(W.key)?.state??"not-started"})}),$.length&&(T=Math.max(T,L+($.length-1)*p+m))};for(const $ of e.epics){const P=[...$.features.map(I=>({kind:"feature",f:I})),...$.stories.length?[{kind:"stories"}]:[]],L=Math.max(1,P.length),W=L*s+(L-1)*r;b>a&&b+W+a>n&&(w+=1,b=a,S=T+i,T=S+c+u);const F=b+W/2;g.push({key:$.key,level:"epic",row:w,x:b,y:S,w:W,h:l,title:$.title,done:Od(Ti($),x)});const U=P.map((I,D)=>b+D*(s+r)+s/2);U.length&&(j.push({x1:F,y1:S+l,x2:F,y2:S+k}),j.push({x1:Math.min(F,U[0]),y1:S+k,x2:Math.max(F,U.at(-1)),y2:S+k})),P.forEach((I,D)=>{const M=b+D*(s+r),Y=U[D];I.kind==="feature"?(j.push({x1:Y,y1:S+k,x2:Y,y2:S+c}),g.push({key:I.f.key,level:"feature",row:w,x:M,y:S+c,w:s,h:u,title:I.f.title,done:Od(I.f.stories,x)}),I.f.stories.length&&j.push({x1:Y,y1:S+c+u,x2:Y,y2:S+h}),z(I.f.stories,M,S+h)):(j.push({x1:Y,y1:S+k,x2:Y,y2:S+h}),z($.stories,M,S+h))}),E=Math.max(E,b+W+a),b+=W+i}return{boxes:g,lines:j,width:E,height:T+a}}function v1(e){return ku(e)?"m":e==="building"?"b":e==="needs-you"?"y":"w"}function r$(e,n){const s=Math.max(Ys.pad/2,Math.min(n.x,e.width-Ys.popW-Ys.pad/2)),r=s+Ys.popW,i=e.boxes.filter(l=>l.level!=="epic"&&l.row===n.row&&l.x<r&&l.x+l.w>s).map(l=>l.y+l.h),a=Math.max(n.y+n.h,...i)+14;return{left:s,top:a,height:Math.max(e.height,a+Ys.popH+Ys.pad)}}function i$(e,n){if(!n.width||!n.height)return 1;const s=Math.min(n.width/e.width,n.height/e.height,1);return Math.max(.3,Math.round(s*100)/100)}function a$(e,n){return n.width?Math.max(.6,Math.min(1,Math.round(n.width/e.width*100)/100)):1}const vu=3,o$=380,l$=90,c$={open:[],seen:{},looked:{},lead:null};function rf(e,n=e<=760){return n?1:Math.max(1,Math.min(vu,Math.floor((e-l$-16)/o$)))}function Kb(e,n,s=vu){return e.open.some(r=>r.id===n)?{...e,open:e.open.map(r=>r.id===n?{...r,min:!1}:r)}:{...e,open:[{id:n,min:!1},...e.open].slice(0,Math.max(1,s))}}function Vb(e,n){return{...e,open:e.open.filter(s=>s.id!==n),...n==="lead"?{lead:null}:{}}}function d$(e,n){return{...e,open:e.open.map(s=>s.id===n?{...s,min:!0}:s)}}function u$(e,n,s=vu){const r=e.open.find(i=>i.id===n);return!r||r.min?Kb(e,n,s):Vb(e,n)}function h$(e,n){if(n<=1){const s=e.open.find(r=>!r.min)??e.open[0];return s?[s]:[]}return e.open.slice(0,n)}function p$(e,n){return e.open.some(s=>n.has(s.id))?{...e,open:e.open.filter(s=>!n.has(s.id))}:e}function Yb(e,n){return e.open.some(s=>s.id===n&&!s.min)}function m$(e,n){if(!n.size)return e;const s=l=>Object.fromEntries(Object.entries(l).filter(([c])=>n.has(c))),r=s(e.seen),i=s(e.looked);return Object.keys(r).length===Object.keys(e.seen).length&&Object.keys(i).length===Object.keys(e.looked).length?e:{...e,seen:r,looked:i}}function f$(e,n){const s=e&&typeof e=="object"?e:{},r=Array.isArray(s.open)?s.open.filter(l=>!!l&&typeof l.id=="string").map(l=>({id:l.id,min:!!l.min})):[],i=l=>l&&typeof l=="object"?l:{},a=s.seen?i(s.seen):i(n?.seen);return{open:r.slice(0,vu),seen:a,looked:i(s.looked),lead:typeof s.lead=="string"?s.lead:null}}const Gb=`sk.popups.${gt??"local"}`,af=new Set;function Qb(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}function g$(){const e=Qb();try{const n=e?.getItem(Gb),s=n?void 0:JSON.parse(e?.getItem("sk.chatdock")??"null");return f$(n?JSON.parse(n):null,s)}catch{return c$}}let zt=g$();function Nr(e){if(e!==zt){zt=e;try{Qb()?.setItem(Gb,JSON.stringify(zt))}catch{}for(const n of af)n()}}const of=()=>typeof window>"u"?1440:window.innerWidth,Nt={get:()=>zt,open:e=>Nr(Kb(zt,e,rf(of()))),toggle:e=>Nr(u$(zt,e,rf(of()))),close:e=>Nr(Vb(zt,e)),minimise:e=>Nr(d$(zt,e)),follow:e=>zt.lead!==e&&Nr({...zt,lead:e}),seen:(e,n)=>zt.seen[e]!==n&&Nr({...zt,seen:{...zt.seen,[e]:n}}),prune:e=>Nr(m$(zt,e)),looked:(e,n)=>n&&zt.looked[e]!==n&&Nr({...zt,looked:{...zt.looked,[e]:n}})};function bu(){return N.useSyncExternalStore(e=>(af.add(e),()=>af.delete(e)),()=>zt)}function Ia(e){return N.useSyncExternalStore(n=>{const s=window.matchMedia?.(e);return s?.addEventListener("change",n),()=>s?.removeEventListener("change",n)},()=>!!window.matchMedia?.(e).matches)}const wu="(max-width: 760px)";function x$(){return N.useSyncExternalStore(e=>(window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)),of)}function Zb(e,n){return Math.max(1,Math.ceil((n-e)/28))}const Xb=38,Al="(prefers-reduced-motion: reduce)",lf=new Set;function Jb(e,n){const s=Ia(Al),r=Ld(e),i=N.useRef(n&&!s);n&&!s&&(i.current=!0);const[a,l]=N.useState(()=>i.current?0:r),c=i.current&&!s;N.useEffect(()=>{if(!c||a>=r)return;const h=setTimeout(()=>l(m=>Math.min(r,m+Zb(m,r))),Xb);return()=>clearTimeout(h)},[c,a,r]);const u=c?Math.min(a,r):r;return{shown:u,total:r,done:u>=r}}function y$(e){return e==="met"?"Met":e==="broken"?"Not working yet":e==="not-shown"?"Not shown yet":e==="off-screen"?"Not on a screen":null}function Nu(e){return e==="met"?"met":e==="broken"?"broken":e==="not-shown"?"notshown":e==="off-screen"?"notonscreen":""}function ka(e){return e.shows==="broken"||e.shows==="not-shown"||e.shows==="off-screen"?e.why??e.note??"":e.note??""}function j$(e){const n=(e.proof??[]).filter(s=>s.shows==="off-screen").map(s=>({criterion:s.criterion,why:ka(s)}));return[...n,...(e.offScreen??[]).filter(s=>!n.some(r=>r.criterion===s.criterion))]}const _d=e=>e.endsWith(".api.json"),ew=e=>/\.(api|rows|test|none)\.json$/.test(e),k$=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="640" height="200"><text x="24" y="100" font-family="sans-serif" font-size="20">A saved proof, not a picture</text></svg>')}`;function b1(e,n){const s=a=>ew(a)?k$:n(a),r=[],i=[];for(const a of e)i.push(r.length),r.push({src:s(a.before),caption:`${a.criterion} · ${a.beforeLabel}`},{src:s(a.after),caption:`${a.criterion} · ${a.afterLabel}`}),(a.more??[]).forEach((l,c)=>r.push({src:s(l.after),caption:`${a.criterion} · ${l.note||`Picture ${c+2}`}`}));return{pictures:r,starts:i}}function w1(e){const n=e.waiting?.kind;if(!n||e.now?.merging)return null;switch(n){case"proof":return"proof";case"spec":return"spec";case"plan":return e.specApproved?"design":"plan";case"questions":return(e.questions??[]).some(s=>!s.answer)?"questions":"open";case"ask":{const s=e.agentQuestion;return s&&!s.port&&!s.kind?"ask":"open"}case"split":return e.split?.suggestion?"split":"open";case"chat":return null;default:return"open"}}function v$(e,n){return e?!e.waiting||e.now?.merging?"decided":!n||!e.waitKey||n===e.waitKey?"live":n.split(":")[0]===e.waitKey.split(":")[0]?"changed":"decided":"gone"}function tw(e){return(e.proof??[]).filter(n=>n.after&&!ew(n.after)).map(n=>({file:n.after,label:n.criterion}))}function b$(e,n){switch(n){case"proof":return tw(e).length>0||(e.proof??[]).some(s=>s.after);case"spec":return!!(e.story?.trim()||e.criteria?.length);case"plan":case"design":return!!(e.steps?.length||e.decision);case"questions":return(e.questions??[]).some(s=>!s.answer);case"ask":return!!e.agentQuestion?.text.trim();case"split":return!!e.split?.suggestion;default:return!0}}function cf(e,n){switch(n){case"proof":return"Proof for you";case"spec":return"Spec for you";case"plan":return"Plan for you";case"design":return"Design for you";case"questions":return"Questions for you";case"ask":return`${w$(e.agentQuestion?.from??"builder")} asks you`;case"split":return"Suggestion for you";default:return"Waits for you"}}function w$(e){return{analyst:"Analyst",architect:"Architect",builder:"Builder",reviewer:"Reviewer",tester:"Tester"}[e]}function N1(e){if(e.chat)return e.chat.with;const n=e.clock?.who;if(!e.waiting&&n&&n!=="squad")return n;switch(e.waiting?.kind){case"proof":return"tester";case"plan":return"architect";case"ask":return e.agentQuestion?.from??"builder";case"stuck":return"builder";default:return"analyst"}}function nw(e){return e==="proof"?"Builder":e==="spec"?"Analyst":e==="design"?"Architect":"Spec writer"}function N$(e){return e==="proof"?"Looks right":e==="spec"?"Approve spec":e==="design"?"Approve design":e==="plan"?"Approve plan":"Open"}function S$(e,n){return n?"The lead brings this card. Only you can press it.":e==="proof"?"It is accepted for the next release after your OK.":e==="spec"?"The Architect designs it after your OK.":"Building starts after your OK."}function gd(e,n,s,r){if(r==="change")return`You sent it back with your note. The ${nw(e)} works on it now.`;if(r==="answers")return`You sent your answers. ${s?.status?`${n}: ${s.status}.`:"The squad carries on."}`;if(typeof r=="object")return`You answered “${r.answer}”. ${s?.status?`${n}: ${s.status}.`:"The squad carries on."}`;switch(e){case"proof":return s?.mergedAt||s?.stage==="release"?`You pressed Looks right. ${n} is accepted${s.mergedAt?" and merged":""}, ready for the next release.`:s?.live?"You pressed Looks right. Newer work changed the same code, so the Builder brings it in first. Then the proof comes back to you.":`You pressed Looks right. ${n}: ${s?.status??"saved"}.`;case"spec":return"You approved the spec. The Architect is designing how to build it.";case"design":return"You approved the design. Building starts now.";default:return"You approved the plan. The Builder started."}}const sw=`sk.pressed.${gt??"local"}`;function rw(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}function Bj(e,n){return`${e}|${n??""}`}function S1(){try{return JSON.parse(rw()?.getItem(sw)??"{}")}catch{return{}}}function C$(e){const n=s=>s&&(e.made||e.state!=="live"||!e.waitKey||!s.key||s.key===e.waitKey)?s:null;return n(e.mine)??n(e.kept)??(!e.made&&e.state!=="live"?e.latest:null)}function iw(e,n=Date.now()){return Object.entries(S1()).filter(([r,i])=>r.startsWith(`${e}|`)&&n-Date.parse(i.at)<18e5).sort((r,i)=>i[1].at.localeCompare(r[1].at))[0]?.[1]??null}function $$(e,n=Date.now()){return iw(e,n)!==null}function T$(e,n,s,r){const i={...S1(),[e]:{words:n,at:new Date().toISOString(),...s?{kind:s}:{},...r?{key:r}:{}}},a=Object.fromEntries(Object.entries(i).sort((l,c)=>c[1].at.localeCompare(l[1].at)).slice(0,40));try{rw()?.setItem(sw,JSON.stringify(a))}catch{}return a}const Lo=e=>`${e.at}|${e.who}`,df=e=>e.who!=="you"&&e.who!=="squad";function E$(e,n,s){const r=N.useRef(null),i=N.useRef(null),a=N.useRef({text:"",shown:0}),[l,c]=N.useState(null);return N.useEffect(()=>{if(!n)return;const h=e.map(Lo);if(!r.current){r.current=new Set(h),i.current=new Set(h);return}const m=e.filter(j=>!r.current.has(Lo(j)));for(const j of h)r.current.add(j);const p=m.filter(df).at(-1);if(!p||s)return;const x=a.current,g=x.text&&p.text.startsWith(x.text.slice(0,40))?Math.min(x.shown,Ld(p.text)):0;a.current={text:"",shown:0},c({key:Lo(p),shown:g,total:Ld(p.text)})},[n,e,s]),N.useEffect(()=>{if(!l)return;if(l.shown>=l.total){c(null);return}const h=setTimeout(()=>c(m=>m&&{...m,shown:m.shown+Zb(m.shown,m.total)}),Xb);return()=>clearTimeout(h)},[l]),{writing:l,fresh:h=>!!(i.current&&!i.current.has(Lo(h))),drafted:a}}const Wj=72,A$=12;class P${constructor(n=()=>{}){this.onChange=n}pinned=!0;unseen=0;box=null;content=null;settled=!1;last=0;count=null;anchor=null;attach(n,s){this.box=n,this.content=s,n&&(this.settled=!1,this.place())}reset(){this.settled=!1,this.count=null,this.set(!0,0),this.place()}touched(){this.settled=!0}onScroll(){const n=this.box;if(!n)return;const s=n.scrollTop;Math.abs(s-this.last)>1&&(this.settled=!0),Uj(n)<=Wj?this.set(!0,0):s<this.last-1&&this.set(!1,this.unseen),this.last=s,this.keepAnchor()}onResize(){const n=this.box;if(!n)return;if(!this.settled)return this.place();if(this.pinned)return this.down(n);const s=this.anchor,r=s?this.content?.children[s.i]:void 0;if(!s||!r)return;const i=Xp(n,r)-s.top;Math.abs(i)>.5&&(n.scrollTop+=i,this.last=n.scrollTop)}onCount(n){const s=this.count;this.count=n,!(s===null||n<=s)&&this.settled&&!this.pinned&&this.set(!1,this.unseen+(n-s))}toBottom(n=!1){this.settled=!0,this.set(!0,0);const s=this.box;if(!s)return;const r=s.scrollTo;n&&r?r.call(s,{top:s.scrollHeight,behavior:"smooth"}):this.down(s)}place(){const n=this.box;if(!n)return;const s=n.querySelector("[data-new-line]");s?(n.scrollTop=Math.max(0,n.scrollTop+Xp(n,s)-A$),this.last=n.scrollTop,this.set(Uj(n)<=Wj,this.unseen),this.keepAnchor()):(this.set(!0,0),this.down(n))}down(n){n.scrollTop=Math.max(0,n.scrollHeight-n.clientHeight),this.last=n.scrollTop}keepAnchor(){const n=this.box,s=this.content?.children;if(!(!n||!s)){for(let r=0;r<s.length;r++){const i=s[r];if(i.getBoundingClientRect().bottom-n.getBoundingClientRect().top>0){this.anchor={i:r,top:Xp(n,i)};return}}this.anchor=null}}set(n,s){n===this.pinned&&s===this.unseen||(this.pinned=n,this.unseen=s,this.onChange({pinned:n,unseen:s}))}}function Uj(e){return e.scrollHeight-e.scrollTop-e.clientHeight}function Xp(e,n){return n.getBoundingClientRect().top-e.getBoundingClientRect().top}function C1(e,n){const[s,r]=N.useState({pinned:!0,unseen:0}),i=N.useRef(null);i.current||(i.current=new P$(r));const a=i.current,l=N.useRef({box:null,content:null}),c=N.useCallback(()=>{const{box:x,content:g}=l.current;if(l.current.off?.(),l.current.off=void 0,!x||!g)return a.attach(null,null);x.style.overflowAnchor="none",a.attach(x,g);const j=()=>a.onScroll(),k=()=>a.touched();x.addEventListener("scroll",j,{passive:!0});for(const w of["wheel","touchstart","keydown","pointerdown"])x.addEventListener(w,k,{passive:!0});const b=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>a.onResize());b?.observe(x),b?.observe(g),l.current.off=()=>{x.removeEventListener("scroll",j);for(const w of["wheel","touchstart","keydown","pointerdown"])x.removeEventListener(w,k);b?.disconnect()}},[a]),u=N.useCallback(x=>{l.current.box!==x&&(l.current.box=x,c())},[c]),h=N.useCallback(x=>{l.current.content!==x&&(l.current.content=x,c())},[c]);N.useEffect(()=>()=>l.current.off?.(),[]);const m=N.useRef(e);N.useEffect(()=>{m.current!==e&&(m.current=e,a.reset())},[e,a]),N.useEffect(()=>a.onCount(n),[n,a]);const p=N.useCallback((x=!1)=>a.toBottom(x&&!window.matchMedia?.(Al).matches),[a]);return{...s,boxRef:u,contentRef:h,toBottom:p}}function $1({s:e}){if(e.pinned)return null;const n=e.unseen?`${e.unseen} new ${e.unseen===1?"message":"messages"}`:"";return t.jsx("div",{className:"tobottom-w",children:t.jsxs("button",{className:`tobottom ${n?"has":""}`,onClick:()=>e.toBottom(!0),"aria-label":n?`${n}: go down to them`:"Go to the newest message",children:[t.jsx(Wv,{size:14,strokeWidth:2.4,"aria-hidden":"true"}),n&&t.jsx("span",{children:n})]})})}function R$(){return t.jsx("div",{className:"newline","data-new-line":!0,role:"separator","aria-label":"New messages from here",children:t.jsx("span",{children:"New"})})}const Dd=N.createContext(null);function aw(e){const[n,s]=N.useState(null),r=N.useRef(e);r.current=e;const i=N.useCallback(u=>{s(u),r.current?.()},[]),a=N.useCallback(u=>s(h=>h===u?null:h),[]),l=N.useCallback(()=>s(null),[]),c=N.useMemo(()=>({ask:i,release:a}),[i,a]);return{box:n,cancel:l,door:c}}function ow(){const e=N.useContext(Dd),n=N.useRef(null);N.useEffect(()=>()=>{n.current&&e?.release(n.current)},[e]);const s=N.useCallback(i=>{n.current=i,e?.ask(i)},[e]),r=N.useCallback(()=>{n.current&&e?.release(n.current),n.current=null},[e]);return N.useMemo(()=>e?{ask:s,done:r}:null,[e,s,r])}function T1({box:e,onCancel:n}){return t.jsxs("div",{className:"boxask",role:"status",children:[t.jsx("span",{children:e.label}),t.jsx("button",{className:"linkbtn",onClick:n,children:"Cancel"})]})}function Hj({t:e,box:n,onCancel:s}){const[r,i]=N.useState(""),a=tt(r);return t.jsxs("div",{className:"ccomp",children:[t.jsx(T1,{box:n,onCancel:s}),t.jsxs("div",{className:"cbox",children:[t.jsx("textarea",{className:`cta ${r?Fs(a):"t-en"}`,dir:r?a.dir:"auto",rows:1,autoFocus:!0,value:r,placeholder:n.placeholder,"aria-label":`What is wrong with ${e.id}`,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Enter"&&!l.shiftKey&&!l.nativeEvent.isComposing&&r.trim()&&(l.preventDefault(),n.send(r.trim()))}}),t.jsxs("div",{className:"crow",children:[t.jsx("span",{className:"grow"}),t.jsx("button",{className:"csend",onClick:()=>r.trim()&&n.send(r.trim()),disabled:!r.trim(),"aria-label":"Send",children:t.jsx(Zn,{size:17})})]})]})]})}const lw="squad.draft.",q$=720*60*60*1e3,va=new Map;function Pl(){try{return window.localStorage}catch{return null}}function ba(e,n,s){return`${lw}${e??"app"}.${n}.${s}`}function I$(e,n){const s=va.get(e);if(s!==void 0)return s;try{return n?.getItem(e)??null}catch{return null}}function il(e,n=Pl(),s=Date.now()){const r=I$(e,n);if(r)try{const{v:i,at:a}=JSON.parse(r);return s-a>q$?void 0:i}catch{return}}function E1(e,n,s=Pl(),r=Date.now()){const i=JSON.stringify({v:n,at:r});try{if(!s)throw new Error("no storage");s.setItem(e,i),va.delete(e)}catch{va.set(e,i)}}function al(e,n=Pl()){va.delete(e);try{n?.removeItem(e)}catch{}}function Jp(e,n,s=Pl()){const r=ba(e,n,"");for(const i of[...va.keys()])i.startsWith(r)&&va.delete(i);if(s)try{const i=[];for(let a=0;a<s.length;a+=1){const l=s.key(a);l?.startsWith(r)&&i.push(l)}for(const a of i)s.removeItem(a)}catch{}}function F$(e=Pl(),n=Date.now()){if(e)try{const s=[];for(let r=0;r<e.length;r+=1){const i=e.key(r);i?.startsWith(lw)&&il(i,e,n)===void 0&&s.push(i)}for(const r of s)e.removeItem(r)}catch{}}function Kj(e,n,s){const r=ba(gt,e,n),i=il(r);if(i)return i;const a=s();return E1(r,a),a}function $e(e,n,s){const r=ba(gt,e,n),i=N.useRef(JSON.stringify(s)),[a,l]=N.useState(()=>il(r)??s),c=N.useRef(r);c.current!==r&&(c.current=r,i.current=JSON.stringify(s),l(il(r)??s)),N.useEffect(()=>{JSON.stringify(a)===i.current?al(r):E1(r,a)},[r,a]);const u=N.useCallback(()=>{al(r),l(s)},[r]);return[a,l,u]}function Lr(e){return e.owner?.trim()||e.createdBy}function Bd(e,n){return!!e?.trim()&&e.trim().toLowerCase()===n?.trim().toLowerCase()}function Ei(){const e=De();return e.data?.ready?e.data.meta.user?.name:void 0}function ln(e,n){return Bd(Lr(e),n)}function L$(e,n){return ln(e,n)&&!e.takenOver&&e.stage!=="release"&&e.stage!=="done"}function z$({t:e,onClose:n}){const s=re(),r=re(),i=De(),a=Ei(),[l,c,u]=$e(e.id,"hand-over-to",""),[h,m,p]=$e(e.id,"hand-over-note",""),x=i.data?.ready?i.data.meta.engine==="live":!0;e.branch??`${e.id.toLowerCase()}`;const g=!!(e.live||e.squad||e.stopRequested),j=e.chat?.open?"A chat is open on this ticket. Finish the talk first.":g?"The squad is working on it right now. It hands over once the step is done, or you stop it.":null,k=N.useMemo(()=>{const S=new Map;for(const T of i.data?.ready?i.data.tickets:[])for(const E of[Lr(T),T.createdBy,T.specApproved?.by,T.handedOver?.from,T.handedOver?.to,...(T.notes??[]).map(z=>z.by)])E?.trim()&&!Bd(E,a)&&S.set(E.trim().toLowerCase(),E.trim());return[...S.values()].slice(0,8)},[i.data,a]),b=l.trim()||"them",w=()=>l.trim()&&s.mutate({path:`/api/v1/tickets/${e.id}/hand-over`,body:{to:l,note:h},done:`Handed ${e.id} over to ${l.trim()}. Their squad carries on from the saved work.`},{onSuccess:()=>{u(),p(),n()}});return t.jsxs(Ye,{title:`Hand over ${e.id}`,onClose:n,icon:t.jsx("span",{className:"glyph",children:t.jsx(Rd,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!l.trim()||!!j||s.isPending,onClick:w,children:[t.jsx(Rd,{size:15})," ",s.isPending?"Pushing…":"Hand over"]}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad hand-over ${e.id} ${l.trim()?Ci(l.trim()):"Name"}${h.trim()?` --note ${Me(h.trim())}`:""}`})]}),children:[t.jsx("p",{children:"Give this ticket to a teammate. Their squad carries on where it is now."}),j&&t.jsxs("div",{className:"stuckbox",style:{marginBottom:14,display:"flex",gap:10,alignItems:"center"},children:[t.jsx("span",{style:{flex:1},children:j}),g&&!e.chat?.open&&t.jsxs("button",{className:"btn sm",disabled:e.stopRequested||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/stop`,done:"Stopping. The work so far is kept."}),children:[t.jsx(Jn,{size:12})," ",e.stopRequested?"Stopping…":"Stop"]})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"handover-to",children:"Hand it over to"}),t.jsx("input",{id:"handover-to",className:"input",autoFocus:!0,dir:je(l),value:l,placeholder:"Their name, as their board shows it",onChange:S=>c(S.target.value),onKeyDown:S=>S.key==="Enter"&&!j&&!s.isPending&&w()}),k.length>0&&t.jsx("div",{className:"pills",style:{marginTop:8},children:k.map(S=>t.jsxs("button",{className:`pill click ${Bd(S,l)?"on":""}`,onClick:()=>c(S),children:[t.jsx(u1,{size:12})," ",S]},S))})]}),t.jsxs("div",{className:"field",children:[t.jsxs("label",{htmlFor:"handover-note",children:["A note for ",b," (optional)"]}),t.jsx("textarea",{id:"handover-note",className:"input",rows:2,dir:je(h),value:h,placeholder:"Where you got to, and anything to watch out for. Every agent reads it too.",onChange:S=>m(S.target.value)})]}),t.jsx("div",{className:"lbl",children:"What happens"}),t.jsxs("ul",{className:"brief",children:[x?t.jsxs(t.Fragment,{children:[t.jsx("li",{children:"squad-kit saves the work so far and the ticket's documents, and sends them to your team's shared copy of the code."}),t.jsxs("li",{children:[b==="them"?"They become":`${b} becomes`," the owner. Their squad makes its copy of the code from that, and the Builder starts a fresh chat from the spec, the design and the code."]})]}):t.jsxs("li",{children:[b==="them"?"They become":`${b} becomes`," the owner. This is a sample board, so nothing is pushed."]}),t.jsx("li",{children:"Your squad stops working on it. You still see it on your board, with its new owner."})]}),t.jsx("div",{className:"lbl",children:"What stays on this computer"}),t.jsx("p",{className:"note",style:{fontSize:13},children:"Live progress, agent chats and screenshots. They see the documents and the code, not the chat. The Tester takes the screenshots again on their computer."})]})}function M$({t:e}){const n=Ei(),s=e.handedOver;return!s||!Bd(s.to,n)||!ln(e,n)?null:t.jsxs("div",{className:"calm",style:{flex:"none",margin:"16px 28px 0"},children:[t.jsx("span",{className:"ring",children:t.jsx(Rd,{size:16})}),t.jsxs("div",{children:[t.jsxs("b",{children:[s.from," handed this ticket to you ",st(s.at)]}),t.jsxs("span",{children:["The spec, the design, the notes and the code came with it. Live progress, agent chats and screenshots stayed on ",s.from,"'s computer, so the Builder starts a fresh chat from the spec, the design and the code, and the Tester takes the screenshots again."]})]})]})}function O$({t:e}){const n=Lr(e),s=e.handedOver,r=re(),[i,a]=N.useState(!1),[l,c,u]=$e(e.id,"take-back","");return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:t.jsx(u1,{size:17})}),t.jsxs("div",{children:[t.jsxs("b",{children:[n," owns this ticket"]}),t.jsxs("span",{children:[s?`${s.from} handed it to ${s.to} ${st(s.at)}. `:"","Their squad works on it, on their computer. You see their work here when they push it: when they hand it over, or when its pull request opens."]})]})]}),t.jsxs("p",{className:"note",style:{marginTop:12,fontSize:13},children:["Live progress and agent chats stay on ",n,"'s computer. The spec, the design and the notes here are as ",n," last pushed them."]})]}),i?t.jsxs("div",{className:"df",children:[t.jsx("input",{className:"input",style:{flex:1},autoFocus:!0,dir:je(l),value:l,onChange:h=>c(h.target.value),placeholder:`Why you take it from ${n}, for example: the name was misspelled`}),t.jsx("button",{className:"btn pri",disabled:!l.trim()||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/take-back`,body:{reason:l},done:`${e.id} is yours now. The reason stays on the ticket.`},{onSuccess:u}),children:"Take it"}),t.jsx("button",{className:"btn",onClick:()=>a(!1),children:"Cancel"}),t.jsx(X,{text:`squad take-back ${e.id} --reason ${Me(l.trim()||"…")}`})]}):t.jsxs("div",{className:"df",children:[e.stage!=="done"&&t.jsxs("button",{className:"btn quiet",title:`When ${n} cannot work on it: the name was misspelled, or they left. If ${n} is working on it, talk to them first.`,onClick:()=>a(!0),children:[n," cannot work on it? Take it"]}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad show ${e.id}`})]})]})}function zs({pictures:e,start:n,onClose:s}){const[r,i]=N.useState(n),a=e.length,l=N.useCallback(u=>i(h=>(h+u+a)%a),[a]);N.useEffect(()=>{const u=h=>{h.key==="Escape"?s():h.key==="ArrowRight"?l(1):h.key==="ArrowLeft"&&l(-1)};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[s,l]);const c=e[r];return c?kl.createPortal(t.jsxs("div",{className:"lightbox",role:"dialog","aria-modal":"true","aria-label":c.caption,onMouseDown:u=>u.target===u.currentTarget&&s(),children:[t.jsxs("div",{className:"lb-top",children:[t.jsx(R,{className:"lb-cap",text:c.caption}),a>1&&t.jsxs("span",{className:"lb-count",children:[r+1," of ",a]}),t.jsx("span",{className:"grow"}),t.jsx("a",{className:"iconbtn",href:c.src,target:"_blank",rel:"noreferrer","aria-label":"Open in a new tab",title:"Open in a new tab",children:t.jsx(Xt,{size:15})}),t.jsx("button",{className:"iconbtn",onClick:s,"aria-label":"Close",children:t.jsx(Ue,{size:16})})]}),t.jsx("img",{className:"lb-img",src:c.src,alt:c.caption,onMouseDown:u=>u.stopPropagation()}),a>1&&t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"lb-nav prev",onClick:()=>l(-1),"aria-label":"Previous picture",children:t.jsx(Kv,{size:22})}),t.jsx("button",{className:"lb-nav next",onClick:()=>l(1),"aria-label":"Next picture",children:t.jsx(hu,{size:22})})]})]}),document.body):null}function A1({src:e,alt:n,className:s}){const[r,i]=N.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"zoom",onClick:()=>i(!0),"aria-label":`Open ${n} full size`,children:t.jsx("img",{className:s,src:e,alt:n,loading:"lazy"})}),r&&t.jsx(zs,{pictures:[{src:e,caption:n}],start:0,onClose:()=>i(!1)})]})}function cw(e,n){return ve({queryKey:["mockup-link",e,n],queryFn:()=>ye(`/api/v1/tickets/${encodeURIComponent(e)}/mockup-link?path=${encodeURIComponent(n)}`),staleTime:1/0})}function dw({ticket:e,file:n,title:s,opener:r,onClose:i}){const a=cw(e,n),l=N.useRef(null),c=N.useRef(null);return N.useEffect(()=>{const u=r??document.activeElement;return l.current?.focus(),()=>{u?.isConnected&&u.focus?.()}},[r]),N.useEffect(()=>{const u=m=>{m.key==="Escape"&&(m.stopPropagation(),i())},h=m=>{m.source===c.current?.contentWindow&&m.data?.squadKit==="mockup-escape"&&i()};return window.addEventListener("keydown",u,!0),window.addEventListener("message",h),()=>{window.removeEventListener("keydown",u,!0),window.removeEventListener("message",h)}},[i]),kl.createPortal(t.jsxs("div",{className:"mockview-veil",onMouseDown:u=>u.target===u.currentTarget&&i(),children:[t.jsx("span",{className:"mockview-guard",tabIndex:0,onFocus:()=>(c.current??l.current)?.focus()}),t.jsxs("div",{className:"mockview",role:"dialog","aria-modal":"true","aria-label":s,children:[t.jsxs("header",{children:[t.jsx(R,{as:"h3",text:s}),t.jsx("span",{className:"mockview-hint",children:"Click around, it is only a picture of the idea"}),t.jsx("button",{ref:l,className:"iconbtn",onClick:i,"aria-label":"Close",title:"Close (Esc)",children:t.jsx(Ue,{size:16})})]}),a.isError?t.jsx("p",{className:"note mockview-err",children:"The mockup could not be read."}):t.jsx("iframe",{ref:c,className:"mockview-frame",title:s,sandbox:"allow-scripts",src:a.data?.url??"about:blank"})]}),t.jsx("span",{className:"mockview-guard",tabIndex:0,onFocus:()=>l.current?.focus()})]}),document.body)}const Vj=/\.(png|jpe?g|gif|webp)$/i,Yj=/\.html?$/i;function uw({ticket:e,files:n}){const s=n.filter(a=>Vj.test(a)),r=n.filter(a=>Yj.test(a)),i=n.filter(a=>!Vj.test(a)&&!Yj.test(a));return t.jsxs("div",{className:"attached",children:[r.map(a=>t.jsx(P1,{ticket:e,file:a},a)),s.length>0&&t.jsx("div",{className:"attpics",children:s.map(a=>t.jsx(A1,{src:In(e,a),alt:Gj(a)},a))}),i.map(a=>t.jsxs("a",{className:"btn sm",href:In(e,a),download:!0,children:[t.jsx(gs,{size:13})," ",Gj(a)]},a))]})}function P1({ticket:e,file:n,title:s="Mockup",preview:r}){const[i,a]=N.useState(null),l=D$(),c=cw(e,n);if(c.isError)return t.jsx("p",{className:"note",children:"The mockup could not be read."});const u=i&&t.jsx(dw,{ticket:e,file:n,title:s,opener:i,onClose:()=>a(null)});return r?t.jsxs("div",{className:"mockprev",children:[t.jsx("button",{className:"mockprev-pic",ref:l,onClick:h=>a(h.currentTarget),"aria-label":`Open the mockup: ${s}`,children:t.jsx("iframe",{className:"mockprev-frame",title:s,sandbox:"allow-scripts",src:c.data?.url??"about:blank",tabIndex:-1,"aria-hidden":"true",loading:"lazy"})}),t.jsxs("button",{className:"linkbtn mockprev-open",onClick:h=>a(h.currentTarget),children:[t.jsx(el,{size:12,"aria-hidden":"true"})," Open the mockup"]}),u]}):t.jsxs("div",{className:"mockup",children:[t.jsxs("div",{className:"mockbar",children:[t.jsxs("span",{children:[s," · click around, it is only a picture of the idea"]}),t.jsxs("button",{className:"btn sm",onClick:h=>a(h.currentTarget),children:[t.jsx(el,{size:12})," Full size"]})]}),t.jsx("iframe",{className:"mockframe",title:s,sandbox:"allow-scripts",src:c.data?.url??"about:blank"}),u]})}const _$=960;function D$(){const e=N.useRef(null);return N.useCallback(n=>{if(e.current?.disconnect(),e.current=null,!n)return;const s=()=>n.style.setProperty("--s",String(Math.max(.1,n.clientWidth/_$)));s(),!(typeof ResizeObserver>"u")&&(e.current=new ResizeObserver(s),e.current.observe(n))},[])}function Gj(e){return e.split(/[\\/]/).pop()??e}function B$({t:e}){return e.mockup?t.jsx(P1,{ticket:e.id,file:e.mockup,title:`${e.title}: mockup`,preview:!0}):null}const W$=["screen","data","api","test","none"],Wd={screen:"Screen",api:"API call",data:"Data",test:"Test",none:"Not on a screen"},U$={screen:"Pictures before and after",api:"The call and its answer",data:"Rows before and after, read only",test:"The test that proves it, in plain words",none:"Only with a reason the Reviewer checks"},R1="stays as it is",H$="For a line that keeps something that already works: its test passes before and after.",hw="Stays as it is: passes before and after",K$="Screen needs a picture. squad-kit keeps it when a line is about what someone sees.",V$="You see this proof when the story is ready to check.";function ol(e){return!!e.criteria?.some(n=>n.proof)}function Y$(e){return e.specApproved||e.live||!e.criteria?.length?!1:e.waiting?.kind==="spec"||e.waiting?.kind==="plan"}function pw(e){return e.kind?e.kind:e.after.endsWith(".api.json")?"api":e.after.endsWith(".rows.json")?"data":"screen"}function G$(e,n,s,r,i){const a=s==="test"&&i!==void 0?i?" --keeps":" --no-keeps":"";return`squad prove ${e} ${n} ${s}${r?` --why ${Me(r)}`:""}${a}`}function mw(e,n){switch(n){case"test":return e.test?e.test.keeps&&e.test.before==="passed"&&e.test.after==="passed"?`${hw}${e.test.seconds!==void 0?` · ${e.test.seconds} s`:""}`:e.test.keeps&&e.test.before==="failed"?"Fails on main: it did not work before":e.test.before==="failed"&&e.test.after==="passed"?`Failed before the change, passes now${e.test.seconds!==void 0?` · ${e.test.seconds} s`:""}`:e.test.after==="failed"?"The test fails":e.test.after==="unknown"?"Could not run the test":e.test.before==="unknown"?"Could not run on the old code":"The test passes on main too":"A test";case"none":return e.checked?`Reviewer: ${Q$(e.checked)}`:"Not checked yet";case"data":return"Rows before and after";case"api":return"The call and its answer";default:return e.more?.length?`${e.more.length+1} pictures`:"Before and after"}}function Q$(e){const n=e.split(/(?<=[.!?؟])\s+/)[0]??e;return n.length>90?`${n.slice(0,89).trimEnd()}…`:n}function q1(e,n){return ol(e)?n==="What the screenshots show"?"What the proof shows":'Each "done when", with its proof':n}const fw={screen:uS,api:Yv,data:Q9,test:Zv,none:V9};function ll({kind:e,locked:n,caret:s,small:r,keeps:i}){const a=fw[e];return t.jsxs("span",{className:`pkind k-${e}${r?" sm":""}`,children:[t.jsx(a,{"aria-hidden":"true"}),Wd[e],i&&e==="test"&&` · ${R1}`,n&&t.jsx(fu,{className:"kindlock","aria-label":"Kept by squad-kit"}),s&&!n&&t.jsx(Aa,{className:"kindcaret","aria-hidden":"true"})]})}function Z$({p:e}){const n=pw(e);return t.jsxs("span",{className:"shortproof",children:[t.jsx(ll,{kind:n,small:!0,keeps:e.test?.keeps}),t.jsx("bdi",{children:mw(e,n)})]})}function gw({t:e,kind:n}){const[s,r]=N.useState(null);if(n==="proof"){const i=tw(e),a=i.map(u=>({src:Mt(`/api/v1/proof/${u.file}`),caption:u.label})),l=e.gates,c=l?.checks==="pass"&&l.review==="pass"?"Checks and review passed":l?.checks==="pass"?"Checks passed":null;return t.jsxs("div",{className:"db",children:[i.length>0&&t.jsx("div",{className:"shots",children:i.slice(0,3).map((u,h)=>t.jsxs("button",{className:"shot",onClick:()=>r(h),"aria-label":`Open the picture full size: ${u.label}`,children:[t.jsx(R,{className:"shot-l",text:u.label}),t.jsx("img",{src:a[h].src,alt:u.label,loading:"lazy"})]},u.file))}),t.jsxs("ul",{children:[(e.proof??[]).map(u=>t.jsxs("li",{className:u.shows&&u.shows!=="met"&&u.shows!=="off-screen"?"warn":"",children:[u.shows&&u.shows!=="met"&&u.shows!=="off-screen"?t.jsx(Fn,{"aria-hidden":"true"}):t.jsx(ce,{"aria-hidden":"true"}),t.jsx(R,{className:"clamp",text:u.criterion}),ol(e)&&t.jsx(Z$,{p:u})]},u.criterion)),c&&t.jsxs("li",{children:[t.jsx(ce,{"aria-hidden":"true"}),t.jsx("span",{children:c})]})]}),s!==null&&t.jsx(zs,{pictures:a,start:s,onClose:()=>r(null)})]})}if(n==="spec"){const i=(e.criteria??[]).filter(a=>a.then).map(a=>a.when?.trim()?`${a.when.trim()[0].toUpperCase()}${a.when.trim().slice(1)}: ${a.then}`:a.then);return t.jsxs("div",{className:"db",children:[e.story&&t.jsx(R,{as:"p",className:"sum",text:X$(e.story,220)}),t.jsx(Qj,{items:i,kinds:ol(e)?(e.criteria??[]).filter(a=>a.then).map(a=>a.proof?.kind??"screen"):void 0,keeps:(e.criteria??[]).filter(a=>a.then).map(a=>!!a.proof?.keeps)})]})}if(n==="plan"||n==="design"){const i=e.decision?.options.find(a=>a.chosen)??e.decision?.options[0];return t.jsxs("div",{className:"db",children:[e.decision&&t.jsx(R,{as:"p",className:"sum",lead:t.jsxs("b",{children:[e.decision.title,":"]}),text:i?.name??""}),t.jsx(B$,{t:e}),t.jsx(Qj,{items:(e.steps??[]).map(a=>a.title)})]})}return n==="ask"?t.jsx("div",{className:"db",children:t.jsx(R,{as:"p",className:"q",text:e.agentQuestion?.text??""})}):n==="questions"?null:t.jsx("div",{className:"db",children:t.jsx(R,{as:"p",className:"sum",text:e.waiting?.summary??e.status})})}function Qj({items:e,kinds:n,keeps:s}){return e.length?t.jsxs("ul",{children:[e.slice(0,3).map((r,i)=>t.jsxs("li",{children:[t.jsx(ce,{"aria-hidden":"true"}),t.jsx(R,{className:"clamp",text:r}),n?.[i]&&t.jsx(ll,{kind:n[i],small:!0,keeps:s?.[i]})]},i)),e.length>3&&t.jsxs("li",{className:"more",children:["and ",e.length-3," more in Read it all"]})]}):null}function X$(e,n){const s=e.replace(/\s+/g," ").trim();return s.length>n?`${s.slice(0,n-1).trimEnd()}…`:s}function ua({t:e,label:n,btn:s}){const r=s?"btn":"link";return e.waiting?.kind==="proof"?t.jsxs(ge,{to:"/tickets/$id/proof",params:{id:e.id},className:r,children:[s&&t.jsx(Vm,{size:14,"aria-hidden":"true"}),n]}):t.jsxs(ge,{to:"/board",search:{ticket:e.id},className:r,children:[s?t.jsx(Vm,{size:14,"aria-hidden":"true"}):n==="Read it all"?t.jsx(Dr,{size:13,"aria-hidden":"true"}):null,n]})}const uf="Decide yourself: take the simplest choice that fits the plan, and say what you chose";function J$({t:e,busy:n,onPick:s}){const r=e.agentQuestion;return t.jsx("div",{className:"opts",dir:tt(r.options.join(" ")).dir,children:[...r.options,uf].map((i,a)=>t.jsx("button",{className:"opt",style:{"--i":a},disabled:n,onClick:()=>s(i),...ze(i),children:i===uf?"Let it decide":i},i))})}function eT({t:e,expect:n,onDone:s,onRefused:r}){const i=Ot(),a=e.questions??[],l=Object.fromEntries(a.filter(g=>g.answer).map(g=>[g.id,g.answer])),[c,u,h]=$e(e.id,"answers",l),m=g=>{const j=c[g.id];return!!(j&&(!(j.choice===g.inputOption||j.choice==="Other")||j.value?.trim()))},p=a.find(g=>!m(g)),x=yl({mutationFn:()=>et(`/api/v1/tickets/${e.id}/answers`,"POST",{answers:c,...n?{expect:n}:{}}),onSuccess:g=>{h(),r(null),s(gd("questions",e.id,g,"answers")),i.invalidateQueries()},onError:g=>r(g instanceof Error?g.message:String(g))});return t.jsxs("div",{className:"qs",children:[a.map((g,j)=>{const k=c[g.id];return g!==p&&!m(g)?null:t.jsxs("div",{className:"qrow",children:[t.jsxs("p",{className:"q",...ze(g.text),children:[t.jsx(R,{text:g.text}),t.jsxs("span",{className:"qn",children:[j+1," of ",a.length]})]}),m(g)&&g!==p?t.jsx("button",{className:"me",onClick:()=>u(b=>Object.fromEntries(Object.entries(b).filter(([w])=>w!==g.id))),title:"Pick again",children:t.jsx(R,{text:k.value?.trim()?`${k.choice.replace(/:$/,"")}: ${k.value}`:k.choice})}):t.jsx(tT,{q:g,answer:k,onAnswer:b=>u(w=>({...w,[g.id]:b}))})]},g.id)}),t.jsxs("div",{className:"df",children:[t.jsx("button",{className:"btn pri",disabled:!!p||x.isPending,onClick:()=>x.mutate(),children:p?`Answer all ${a.length} to send`:"Send answers"}),t.jsx(ua,{t:e,label:"Open the questions"})]})]})}function tT({q:e,answer:n,onAnswer:s}){const r=n&&(n.choice===e.inputOption||n.choice==="Other");return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"opts",dir:tt(e.options.join(" ")).dir,children:[...e.options,"Other"].map((i,a)=>t.jsx("button",{className:`opt ${n?.choice===i?"on":""}`,style:{"--i":a},onClick:()=>s({choice:i}),...ze(i),children:i==="Other"?"Something else":i.replace(/:$/,"")},i))}),r&&t.jsx("input",{className:"input",autoFocus:!0,value:n.value??"",dir:n.value?.trim()?tt(n.value).dir:"auto",placeholder:n.choice==="Other"?"Your answer":"Which one?",onChange:i=>s({choice:n.choice,value:i.target.value})})]})}const hf=/^[A-Z][A-Z0-9]*-\d+$/;function I1(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}const Jc=(e,n,s=`${n}s`)=>`${e} ${e===1?n:s}`,nT=e=>e===1?"once":e===2?"twice":`${e} times`;function sT(e){const n=new Set;let s=0,r=0,i=0,a=0,l=!1,c=!1,u=!1,h=!1,m=!1,p=!1,x=!1,g=!1;for(const S of e){const T=S.text;if(S.kind==="code")/^Searched the code|^Looked for files/.test(T)?i++:/^Looked at the code's history/.test(T)?p=!0:/^Read (?!a file outside)/.test(T)?n.add(T.slice(5)):/^Ran a read command/.test(T)?n.add(T):/^Looked in /.test(T)&&i++;else if(S.kind==="story")/^Read decision|^Read the decisions/.test(T)?r++:s++;else if(S.kind==="board")l=!0;else if(S.kind==="log")c=!0;else if(S.kind==="guide")u=!0;else if(S.kind==="notes"&&/^Found it in/.test(T))m=!0;else if(S.kind==="notes"&&!/^Saved what it learned/.test(T))h=!0;else if(S.kind==="app"){x=!0;const E=/^Took (a|\d+) pictures?/.exec(T);E&&(a+=E[1]==="a"?1:Number(E[1]))}else S.kind==="refused"&&(g=!0)}const j=[...s?[Jc(s,"story","stories")]:[],...r?[Jc(r,"decision")]:[],...n.size?[Jc(n.size,"file")]:[],...l?["the board"]:[],...c?["squad-kit's log"]:[],...u?["squad-kit's guide"]:[],...h?["its notes"]:[]],k=[...m?["found it in squad-kit's notes"]:[],...j.length?[`read ${I1(j)}`]:[],...i?[`searched the code ${nT(i)}`]:[],...p?["looked at the code's history"]:[]],b=a?`took ${Jc(a,"picture")} in its own copy of the app`:x?"looked at the app in its own copy":"";let w=k.length>1?`${k.slice(0,-1).join(", ")}, ${k[k.length-1]}`:k[0]??"";return b&&(w=w?`${w}, then ${b}`:b),g&&(w=w?`${w}. squad-kit refused part of the ask`:"squad-kit refused the ask itself"),w&&!w.startsWith("squad-kit")?w[0].toUpperCase()+w.slice(1):w}function xw(e){return e?e.turns.length+e.turns.filter(n=>n.answer||n.error).length:0}function rT(e){return e.length?{line:`${e.length} ${e.length===1?"agent":"agents"} working`,more:e.map(n=>`${n.who} on ${n.story}: ${n.doing}`).join(`
649
+ `)}:{line:"No one is working right now",more:""}}function F1(e){const n=Math.max(0,Math.round(e));if(n<60)return`${n} s`;const s=Math.floor(n/60);return n%60?`${s} min ${n%60} s`:`${s} min`}function ha(e){return e<.005?"under $0.01":`$${e.toFixed(2)}`}function yw(e,n){const s=e.trim(),r=n.trim();return!r||r===s?"":r.startsWith(s)?r.slice(s.length).trim():r}function iT(e){switch(e.answer?.by){case"note":return"From squad-kit's notes, at once. No cost.";case"record":return"From the story's live record, at once. No cost.";case"board":return"From the board's own numbers, at once. No cost.";case"refusal":case"limit":return"squad-kit answered this itself. No cost."}return[...e.seconds!==void 0?[F1(e.seconds)]:[],e.costUsd!==void 0?ha(e.costUsd):"cost not reported"].join(" · ")}const jw={slow:"taking longer than usual",stuck:"looks stuck",waiting:"waits for you",error:"stopped"};function kw(e){switch(e.from){case"app":return`From ${e.app??"your app"}, on ${e.path==="/"?"its first page":e.path}`;case"story":return`About ${e.story}`;case"problem":return e.story?`About ${e.story}: it ${jw[e.problem]}`:"About an error on the board";default:return e.page?`On ${e.page==="Board"?"the Board":e.page}`:"On the board"}}function aT(e){if(e.from==="board")return e.page?`Asked on the ${e.page} page`:"Asked from the board";const n=kw(e);return`Asked ${n[0].toLowerCase()}${n.slice(1)}`}function oT(e){switch(e.from){case"app":return`${e.app??"Your app"} ${e.path}`;case"story":return e.story;case"problem":return e.story?`${e.story}, ${jw[e.problem].replace(/^waits for you$/,"waiting")}`:"An error";default:return e.page??"Board"}}function vw(e,n){switch(e){case"slow":return`Why is ${n} taking longer than usual?`;case"stuck":return`Why does ${n} look stuck, and what should I do?`;case"waiting":return`What does ${n} need from me, and what do you recommend?`;case"error":return`Why did ${n} stop, and what should I do?`}}const lT={overview:"Overview",requirements:"Requirements",board:"Board",backlog:"Backlog",inbox:"Waiting for you",conversations:"Conversations",releases:"Releases",architecture:"Architecture",bugs:"Bugs",harness:"Harness",tools:"Tools",settings:"Settings",lead:"Squad lead"};function cT(e,n={}){const s=typeof n.ticket=="string"&&hf.test(n.ticket)?n.ticket:void 0,r=/^\/tickets\/([^/]+)\/proof/.exec(e)?.[1],i=s??(r&&hf.test(decodeURIComponent(r))?decodeURIComponent(r):void 0);if(i)return{from:"story",story:i};const a=lT[e.split("/")[1]??""];return a?{from:"board",page:a}:{from:"board"}}function dT(e){if(!e)return"/";try{return new URL(e).pathname||"/"}catch{return"/"}}function uT(e){const n=/^\/tickets\/([^/?#]+)\/proof/.exec(e)?.[1];if(n)return{to:"/tickets/$id/proof",id:decodeURIComponent(n)};const s=/^\/board\?(?:.*&)?ticket=([^&#]+)/.exec(e)?.[1],r=/^\/board\?(?:.*&)?tab=(story|plan|proof)(?:[&#]|$)/.exec(e)?.[1];return s?{to:"/board",ticket:decodeURIComponent(s),...r?{tab:r}:{}}:null}function hT(e){return e.kind==="story"&&hf.test(e.ref)?{to:"/board",ticket:e.ref}:e.kind==="decision"?{to:"/architecture",adr:e.ref}:e.kind==="release"?{to:"/releases"}:null}function pT(e){return e.split("/").pop()??e}const em={screen:"Screen",api:"API",data:"Data",test:"Test"};function mT(e){return e.level===1?"On its own":"Needs your OK"}function fT(e){return e.kind==="board_action"&&!!e.allowAlways&&["more_time","pictures_again","start_app","morning_brief"].includes(e.action)}const Zj={more_time:"Always give more time",pictures_again:"Always take them again",start_app:"Always start it",morning_brief:"Always turn it on"};function gT(e){return e.kind==="board_action"&&e.action in Zj?Zj[e.action]:"Always allow"}function bw(e){const n=e.apps?.[0],s=e.squadNow?.find(l=>l.slow)?.story??e.needsYou?.find(l=>l.kind==="slow"||l.kind==="looks-stuck")?.story,r=e.needsYou?.find(l=>l.kind==="stuck")?.story,i=e.squadNow?.[0]?.story,a=s?`Why is ${s} slow?`:r?`Why did ${r} stop?`:i?`What is ${i} doing now?`:"Which story added the sign-in page?";return[n?`How do I sign in to ${n}?`:"How do I sign in to the app?",a,"What's left before the release?"]}function Fa(e){return e.trim()&&tt(e).dir==="rtl"?"ar":"en"}const Wr={en:{sizes:{S:"About a day",M:"A few days",L:"A week or more"},needs:e=>`Needs ${e.join(" and ")}`,who:"Suggestion for you",title:e=>`Split into ${e} stories`,note:(e,n)=>`${e} keeps the first one. The other ${n-1} wait in Tickets, each with its own spec, checks and proof.`,yes:e=>`Split into ${e}`,keep:"Keep as one",change:"Change the split",yours:"Nothing changes until you press.",ask:"Tell the Analyst how to split it…",askLabel:e=>`Goes to the Analyst on ${e}`,send:"Send",cancel:"Cancel",discard:"Discard",notNow:"Not now",done:e=>`Split into ${e.length}. ${I1(e.slice(1))} wait in Tickets.`,kept:"You kept it as one story.",changing:"You asked for another split. The Analyst works on it now.",sent:(e,n)=>`Sent to Requirements as ${n}. ${e} waits in Tickets: delete it, or start it to build it as one story.`,read:e=>`The Analyst read it: this is ${e} stories in one.`,create:e=>`Create ${e} stories`,one:"Create as one story",hint:"You check each one before it starts.",brd:{read:"The Analyst read it: this is a whole requirements document, not one story.",title:"Too big for one story",lead:(e,n)=>`About ${e} stories in ${n} parts:`,unit:e=>e===1?"story":"stories",why:"Requirements breaks it down with you: the Analyst asks its questions first, then you approve the stories part by part, in the right order.",also:"As one story, the squad would try to build all of it at once: slow, costly, and hard to check.",send:"Send to Requirements",anyway:"Make one story anyway",keep:"Keep as one",hint:"Your text and file go with it.",hintText:"Your text goes with it."},found:e=>`squad-kit's own count: ${e.join(", ")}.`,big:{few:"This text looks like several stories. This talk changes nothing on the story: paste it in New ticket, and the Analyst suggests a split there.",brd:"This text looks like a whole requirements document. This talk changes nothing on the story: send it to Requirements to break it into stories."}},ar:{sizes:{S:"حوالي يوم",M:"كام يوم",L:"أسبوع أو أكتر"},needs:e=>`محتاجة ${e.join(" و")}`,who:"اقتراح ليك",title:e=>`قسّمها لـ ${e} قصص`,note:(e,n)=>`${e} تفضل للأولى. ${n===2?"التانية تستنى":`الـ ${n-1} التانيين يستنوا`} في التذاكر، وكل واحدة ليها مواصفات واختبارات وإثبات.`,yes:e=>`قسّمها لـ ${e}`,keep:"خليها واحدة",change:"غيّر التقسيم",yours:"مفيش حاجة هتتغير لحد ما تضغط.",ask:"قول للمحلل تقسمها إزاي…",askLabel:e=>`هيروح للمحلل على ${e}`,send:"ابعت",cancel:"إلغاء",discard:"سيبها",notNow:"مش دلوقتي",done:e=>`اتقسمت لـ ${e.length}. ${e.slice(1).join(" و")} مستنيين في التذاكر.`,kept:"خليتها قصة واحدة.",changing:"طلبت تقسيم تاني. المحلل شغال عليه دلوقتي.",sent:(e,n)=>`اتبعتت للمتطلبات باسم ${n}. ${e} مستنية في التذاكر: امسحها، أو ابدأها عشان تتبني قصة واحدة.`,read:e=>`المحلل قرأها: دي ${e} قصص في قصة واحدة.`,create:e=>`اعمل ${e} قصص`,one:"اعملها قصة واحدة",hint:"هتراجع كل واحدة قبل ما تبدأ.",brd:{read:"المحلل قرأه: ده مستند متطلبات كامل، مش قصة واحدة.",title:"أكبر من قصة واحدة",lead:(e,n)=>`حوالي ${e} قصة في ${n} أجزاء:`,unit:()=>"قصص",why:"صفحة المتطلبات بتقسّمه معاك: المحلل يسأل أسئلته الأول، وبعدين توافق على القصص جزء جزء، بالترتيب الصح.",also:"لو بقى قصة واحدة، الفريق هيحاول يبني كله مرة واحدة: بطيء ومكلّف وصعب يتراجع.",send:"ابعته للمتطلبات",anyway:"اعمله قصة واحدة برضه",keep:"خليها واحدة",hint:"النص والملف هيروحوا معاه.",hintText:"النص هيروح معاه."},found:e=>`عدّ squad-kit: ${e.join("، ")}.`,big:{few:"النص ده شكله كذا قصة. المحادثة دي مش بتغيّر القصة: حطه في تذكرة جديدة، والمحلل هيقترح تقسيمه هناك.",brd:"النص ده شكله مستند متطلبات كامل. المحادثة دي مش بتغيّر القصة: ابعته للمتطلبات عشان يتقسم لقصص."}}};function ww(e){const n=e.split?.was;return Fa(n?`${n.title} ${n.ask}`:`${e.title} ${e.ask}`)}function xT(e){const n=e.areas??[];return{total:n.reduce((s,r)=>s+r.stories,0),parts:n.length}}function yT(e,n){return{size:n.sizes[e.size],needs:e.needs.length?n.needs(e.needs):null}}function Nw(e,n){const s=e.split?.decided;return e.split?.change&&!s?n.changing:s?s.choice==="split"?n.done(s.made??[]):s.choice==="requirements"?n.sent(e.id,s.breakdown??""):n.kept:null}function jT(e,n=Date.now()){const s=e.split?.decided?.at;return!!(s&&e.waiting?.kind!=="split"&&(e.stage==="tickets"||e.stage==="specs")&&n-Date.parse(s)<6*36e5)}function Xj(e){return e?.split?.size??"one"}function Su({s:e,w:n,ids:s}){return t.jsx("ol",{className:"parts",children:e.parts.map((r,i)=>{const a=yT(r,n),l=s?.[i];return t.jsxs("li",{className:"part",style:{"--i":i},children:[t.jsx("span",{className:`num ${l?"sid":""}`,children:l??i+1}),t.jsxs("div",{className:"pt",children:[t.jsx(R,{as:"b",text:r.title}),r.line&&t.jsx(R,{as:"small",text:r.line})]}),t.jsxs("div",{className:"meta",children:[t.jsx("span",{className:"size",children:a.size}),a.needs&&t.jsx("span",{className:"needs",children:a.needs})]})]},i)})})}function Cu({s:e,w:n}){const{total:s,parts:r}=xT(e);return t.jsxs("div",{className:"brd",children:[r>0&&t.jsxs(t.Fragment,{children:[t.jsx("p",{children:n.brd.lead(s,r)}),t.jsx("div",{className:"areas",children:e.areas.map((i,a)=>t.jsxs("span",{className:"area",style:{"--i":a},children:[t.jsx("bdi",{children:i.name}),t.jsxs("small",{children:[i.stories," ",n.brd.unit(i.stories)]})]},a))})]}),t.jsx("p",{children:n.brd.why}),t.jsx("p",{className:"also",children:n.brd.also}),e.found.length>0&&t.jsx("p",{className:"found",children:n.found(e.found.slice(0,3))})]})}function L1({t:e}){const n=e.split?.suggestion,s=ww(e),r=Wr[s],i=s==="ar"?"rtl":"ltr";if(e.waiting?.kind==="split"&&n)return t.jsx(kT,{t:e});const a=Nw(e,r);if(!n||!a)return null;const l=e.split?.decided?.choice==="split"?e.split.decided.made:void 0;return t.jsxs("section",{className:"decide splitcard decided",dir:i,lang:s,"aria-label":`${e.id}: ${a}`,children:[t.jsx(pf,{t:e,title:n.size==="brd"?r.brd.title:r.title(n.parts.length),who:r.who}),t.jsx("div",{className:"db",children:n.size==="brd"?t.jsx(Cu,{s:n,w:r}):t.jsx(Su,{s:n,w:r,...l?{ids:l}:{}})}),t.jsxs("div",{className:"done",role:"status",children:[t.jsx(ce,{"aria-hidden":"true"}),t.jsx(R,{text:a})]})]})}function Jj({t:e}){return jT(e)||e.split?.change&&!e.waiting?t.jsx(L1,{t:e}):null}function pf({t:e,title:n,who:s}){return t.jsxs("div",{className:"dh",children:[t.jsx("span",{className:"sid",children:e.id}),t.jsx("b",{children:n}),t.jsx("span",{className:"who",children:s})]})}function kT({t:e}){const n=Ot(),s=ow(),r=e.split.suggestion,i=ww(e),a=Wr[i],[l,c]=N.useState(!1),[u,h]=N.useState(""),[m,p]=N.useState(null),[x,g]=N.useState(null),[j,k]=N.useState(null),b=yl({mutationFn:({choice:$,text:P})=>et(`/api/v1/tickets/${e.id}/split`,"POST",{choice:$,...P?{note:P}:{},expect:e.waitKey}),onSuccess:$=>{k(null),g(Nw($,a)),s?.done(),n.invalidateQueries()},onError:$=>{k($ instanceof Error?$.message:String($)),n.invalidateQueries()}}),w=($,P)=>{p($),b.mutate({choice:$,...P?{text:P}:{}})},S=()=>{s?s.ask({placeholder:a.ask,label:a.askLabel(e.id),send:$=>w("change",$)}):c(!0)},T=b.isPending,E=r.size==="few",z=i==="ar"?"rtl":"ltr";return x?t.jsxs("section",{className:"decide splitcard decided",dir:z,lang:i,"aria-label":`${e.id}: ${x}`,children:[t.jsx(pf,{t:e,title:E?a.title(r.parts.length):a.brd.title,who:a.who}),t.jsxs("div",{className:"done",role:"status",children:[t.jsx(ce,{"aria-hidden":"true"}),t.jsx(R,{text:x})]})]}):t.jsxs("section",{className:`decide splitcard ${m?"pressing":""}`,dir:z,lang:i,"aria-label":`${e.id}: ${E?a.title(r.parts.length):a.brd.title}`,children:[t.jsx(pf,{t:e,title:E?a.title(r.parts.length):a.brd.title,who:a.who}),t.jsxs("div",{className:"db",children:[E&&r.why&&t.jsx(R,{as:"p",className:"sum",text:r.why}),E?t.jsx(Su,{s:r,w:a}):t.jsx(Cu,{s:r,w:a}),E&&t.jsx("p",{className:"note",children:a.note(e.id,r.parts.length)})]}),j&&t.jsxs("div",{className:"refused",role:"alert",children:[t.jsx(Fn,{size:14,"aria-hidden":"true"}),t.jsx(R,{text:j})]}),l?t.jsxs("div",{className:"df ask",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:u.trim()?tt(u).dir:"auto",value:u,onChange:$=>h($.target.value),placeholder:a.ask,onKeyDown:$=>$.key==="Enter"&&u.trim()&&!T&&w("change",u.trim())}),t.jsx("button",{className:"btn pri",disabled:!u.trim()||T,onClick:()=>w("change",u.trim()),children:a.send}),t.jsx("button",{className:"btn",onClick:()=>c(!1),children:a.cancel})]}):t.jsxs("div",{className:"df",children:[E?t.jsx("button",{className:`btn pri ${m==="split"?"press":""}`,disabled:T,onClick:()=>w("split"),children:a.yes(r.parts.length)}):t.jsx("button",{className:`btn pri ${m==="requirements"?"press":""}`,disabled:T,onClick:()=>w("requirements"),children:a.brd.send}),t.jsx("button",{className:`btn ${m==="keep"?"press":""}`,disabled:T,onClick:()=>w("keep"),children:E?a.keep:a.brd.keep}),E&&t.jsx("button",{className:"link",disabled:T,onClick:S,children:a.change}),t.jsx(X,{text:`squad split ${e.id} ${E?"--yes":"--requirements"}`})]}),t.jsx("p",{className:"yours",children:t.jsx("bdi",{children:a.yours})})]})}function Sw({story:e,made:n,fromLead:s}){const r=De(),i=r.data?.ready?r.data.tickets.find(k=>k.id===e):void 0,a=!r.data,l=N.useRef(n??i?.waitKey),c=a?"live":v$(i,n);c==="live"&&i?.waitKey&&!n&&(l.current=i.waitKey);const[u,h]=N.useState(null),m=C$({mine:u,kept:S1()[Bj(e,l.current)]??null,latest:iw(e),...n?{made:n}:{},state:c,...i?.waitKey?{waitKey:i.waitKey}:{}}),[p,x]=N.useState(null);N.useEffect(()=>x(null),[i?.waitKey]);const g=Ei();if(a)return null;const j=i?w1(i):null;if(i&&j==="split"&&(!g||ln(i,g)))return t.jsx(L1,{t:i});if(m){const k=m.kind??j;return t.jsxs("section",{className:"decide decided","aria-label":`${e}: done`,children:[t.jsx(xd,{t:i,story:e,who:i&&k?cf(i,k):"Done"}),i&&k&&k!=="open"&&k!=="questions"&&k!=="ask"&&t.jsx(gw,{t:i,kind:k}),t.jsxs("div",{className:"done",role:"status",children:[t.jsx(ce,{"aria-hidden":"true"}),t.jsx(R,{text:m.words})]})]})}return c==="live"&&i&&j&&g&&!ln(i,g)?t.jsxs("section",{className:"decide off","aria-label":`${e}: ${Lr(i)}'s`,children:[t.jsx(xd,{t:i,story:e,who:`${Lr(i)}'s`}),t.jsxs("div",{className:"note-row",children:[t.jsxs("bdi",{children:[Lr(i)," owns this story: it waits for them, on their computer."]}),t.jsx(ua,{t:i,label:`Open ${i.id}`})]})]}):c!=="live"||!i||!j?t.jsxs("section",{className:`decide off ${c}`,"aria-label":`${e}: ${c}`,children:[t.jsx(xd,{t:i,story:e,who:c==="changed"?"Changed since":c==="gone"?"Gone":"Decided"}),t.jsx("div",{className:"note-row",children:c==="changed"?t.jsxs(t.Fragment,{children:[t.jsx("bdi",{children:"Changed since this card was made."}),t.jsx(ua,{t:i,label:"Open it"})]}):c==="gone"?t.jsx("bdi",{children:"It is no longer on the board."}):t.jsxs(t.Fragment,{children:[t.jsx(ce,{size:14,strokeWidth:2.6,"aria-hidden":"true"}),t.jsx("bdi",{children:"Already decided on the board."}),i&&t.jsx(ua,{t:i,label:`Open ${i.id}`})]})})]}):t.jsx(vT,{t:i,kind:j,expect:n??i.waitKey,fromLead:!!s,refused:p,onRefused:x,onDone:k=>{const b=n??i.waitKey;T$(Bj(e,b),k,j,b),h({words:k,at:new Date().toISOString(),kind:j,...b?{key:b}:{}})}})}function xd({t:e,story:n,who:s}){return t.jsxs("div",{className:"dh",children:[t.jsx("span",{className:"sid",children:n}),e?t.jsx(R,{as:"b",text:e.title}):t.jsx("b",{}),t.jsx("span",{className:"who",children:s})]})}function vT({t:e,kind:n,expect:s,fromLead:r,refused:i,onRefused:a,onDone:l}){const c=Ot(),u=ow(),[h,m]=N.useState(!1),[p,x]=N.useState(""),[g,j]=N.useState(null),k=yl({mutationFn:({path:z,body:$})=>et(`/api/v1/tickets/${e.id}/${z}`,"POST",{...$,...s?{expect:s}:{}}),onSuccess:(z,$)=>{a(null),l($.words(z&&typeof z=="object"?z:null)),$.then?.(),c.invalidateQueries()},onError:z=>{a(z instanceof Error?z.message:String(z)),c.invalidateQueries()}}),b=z=>k.mutate({path:"change",body:{text:z},words:()=>gd(n,e.id,null,"change"),then:()=>u?.done()}),w=()=>{const z=nw(n);u?u.ask({placeholder:n==="proof"?`Tell the ${z} what is wrong…`:`Tell the ${z} what should change…`,label:`Goes back to the ${z} on ${e.id}`,send:b}):m(!0)},S=()=>{j("yes"),k.mutate({path:"approve",words:z=>gd(n,e.id,z,"yes")})},T=b$(e,n),E=k.isPending;return t.jsxs("section",{className:`decide ${g?"pressing":""}`,"aria-label":`${e.id}: ${cf(e,n)}`,children:[t.jsx(xd,{t:e,story:e.id,who:cf(e,n)}),t.jsx(gw,{t:e,kind:n}),i&&t.jsxs("div",{className:"refused",role:"alert",children:[t.jsx(Fn,{size:14,"aria-hidden":"true"}),t.jsx(R,{text:i})]}),n==="questions"?t.jsx(eT,{t:e,expect:s,onDone:l,onRefused:a}):n==="ask"?t.jsx(J$,{t:e,busy:E,onPick:z=>k.mutate({path:"reply",body:{text:z},words:$=>gd(n,e.id,$,{answer:z===uf?"Let it decide":z})})}):n==="open"?t.jsx("div",{className:"df",children:t.jsx(ua,{t:e,label:`Open ${e.id}`,btn:!0})}):h?t.jsxs("div",{className:"df ask",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:p.trim()?tt(p).dir:"auto",value:p,onChange:z=>x(z.target.value),placeholder:n==="proof"?"What's wrong? One line is enough.":"What should change? One line is enough.",onKeyDown:z=>z.key==="Enter"&&p.trim()&&!E&&b(p)}),t.jsx("button",{className:"btn pri",disabled:!p.trim()||E,onClick:()=>b(p),children:"Send back"}),t.jsx("button",{className:"btn",onClick:()=>m(!1),children:"Cancel"})]}):t.jsxs("div",{className:"df",children:[T&&t.jsx("button",{className:`btn pri ${g==="yes"?"press":""}`,disabled:E,onClick:S,children:E&&g==="yes"?"Saving…":N$(n)}),t.jsx("button",{className:"btn",disabled:E,onClick:w,children:n==="proof"?"Something's wrong":"Ask for changes"}),t.jsx(ua,{t:e,label:n==="proof"?"Full proof":"Read it all"}),t.jsx(X,{text:`squad approve ${e.id}`})]}),!T&&n!=="open"&&t.jsx("p",{className:"yours",children:t.jsx("bdi",{children:"Nothing to look at here yet: open it on the board to check it first."})}),(n==="proof"||n==="spec"||n==="plan"||n==="design"||r)&&t.jsx("p",{className:"yours",children:t.jsx("bdi",{children:S$(n,r)})})]})}function Cw(e){const n=[],s=new Map;for(const{at:r,update:i}of e)switch(i.sessionUpdate){case"user_message_chunk":{const a=i.content.type==="text"&&i.content._meta?.squadKit?.from==="claude-code"?"claude-code":"squad-kit";n.push({kind:"message",from:a,content:i.content,at:r});break}case"agent_message_chunk":n.push({kind:"message",from:"agent",content:i.content,at:r});break;case"agent_thought_chunk":n.push({kind:"message",from:"thought",content:i.content,at:r});break;case"plan":n.push({kind:"plan",entries:i.entries,at:r});break;case"tool_call":{const a={kind:"tool",id:i.toolCallId,title:i.title,toolKind:i.kind??"other",status:i.status??"in_progress",content:[...i.content??[]],command:i.rawInput?.command,at:r};s.set(i.toolCallId,a),n.push(a);break}case"tool_call_update":{const a=s.get(i.toolCallId);if(!a)break;i.status&&(a.status=i.status),i.title&&(a.title=i.title),i.kind&&(a.toolKind=i.kind),i.rawInput?.command&&(a.command=i.rawInput.command),i.content&&(a.content=[...i.content]),i._meta?.squadKit?.blocked?.length&&(a.blocked=i._meta.squadKit.blocked);break}}for(const r of s.values())$T(r);return n}const bT=/^(StructuredOutput|Gave squad-kit its answer|Handed in its answer)$/,wT=/^structured output provided successfully\.?$/i,e2=/User refused permission to run tool|^Permission denied: |haven't granted it yet/i;function tm(e){return e.type==="content"&&e.content.type==="text"?e.content.text.trim():""}function NT(e){return e==="execute"?"Skipped a command this step may not run":e==="edit"||e==="delete"||e==="move"?"Skipped a change this step may not make":"Skipped something this step may not do"}const ST={bash:"Ran a command",terminal:"Ran a command",read:"Read a file",write:"Wrote a file",edit:"Changed a file",multiedit:"Changed a file",notebookedit:"Changed a notebook",glob:"Looked for files",grep:"Searched the code",ls:"Listed a folder",todowrite:"Updated its plan",task:"Asked a helper",agent:"Asked a helper",webfetch:"Opened a web page",fetch:"Opened a web page",websearch:"Searched the web","web search":"Searched the web",enterplanmode:"Planned its work",exitplanmode:"Planned its work","exited plan mode":"Planned its work","approve plan":"Planned its work","unknown tool":"Used a tool"};function CT(e){const n=e.trim(),s=ST[n.toLowerCase()];if(s)return s;const r=/^mcp__([^_]+(?:_[^_]+)*)__(.+)$/.exec(n);return r?`Used ${r[2].replace(/_/g," ")} from ${r[1].replace(/_/g," ")}`:/^[A-Z][a-z]+(?:[A-Z][a-z]+)+$/.test(n)?`Used ${n.replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase()}`:null}function $T(e){if(e.toolKind==="execute"&&e.command&&e.title.trim()===e.command.trim()&&(e.title=`Ran ${e.command.split(`
650
+ `)[0].slice(0,80)}`),bT.test(e.title)){e.answer=!0,e.title="Handed in its answer",e.content=e.content.filter(s=>!wT.test(tm(s)));return}if(e.status==="failed"&&e.content.some(s=>e2.test(tm(s)))){e.skipped=!0,e.detail=e.title,e.title=NT(e.toolKind),e.content=e.content.filter(s=>!e2.test(tm(s)));return}const n=CT(e.title);n&&(e.title=n)}function tr(e){return e.stage==="release"||e.stage==="done"}function $u(e){return tr(e)||!!e.specApproved||["implement","test","review"].includes(e.stage)}function TT(e){return e.part==="story"?"The story":e.index===void 0?"New done when":`Done when ${e.index+1}`}function mf(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`:String(e[0]??"")}function t2({parts:e}){return t.jsx("div",{className:"changeparts",children:e.map((n,s)=>t.jsxs("div",{className:"chrow",children:[t.jsx("div",{className:"chlabel",children:TT(n)}),n.before?t.jsx(R,{as:"div",className:"chold",text:n.before}):t.jsx("div",{className:"chold empty",children:t.jsx("i",{children:"new"})}),n.after?t.jsx(R,{as:"div",className:"chnew",text:n.after}):t.jsx("div",{className:"chnew",children:t.jsx("i",{children:"removed"})})]},s))})}const n2={same:"Stays",changed:"Redone",new:"New"};function ET({c:e}){const n=e.design,s=n.before.filter(i=>!n.steps.some(a=>a.title===i)),r=n.steps.flatMap((i,a)=>i.change==="same"?[a+1]:[]);return t.jsxs("div",{className:"changeparts",children:[r.length>0&&t.jsxs("div",{className:"chrow",children:[t.jsxs("div",{className:"chlabel",children:[r.length===1?"Step":"Steps"," ",mf(r)]}),t.jsx("div",{children:t.jsx("span",{className:"pill wait",children:n2.same})}),t.jsx("div",{className:"chnew note",children:"Built already, as they are."})]}),n.steps.map((i,a)=>i.change==="same"?null:t.jsxs("div",{className:"chrow",children:[t.jsxs("div",{className:"chlabel",children:["Step ",a+1]}),t.jsx("div",{children:t.jsx("span",{className:"pill you",children:n2[i.change]})}),t.jsx(R,{as:"div",className:"chnew",text:i.title})]},a)),s.map(i=>t.jsxs("div",{className:"chrow",children:[t.jsx("div",{className:"chlabel",children:"Dropped"}),t.jsx("div",{}),t.jsx(R,{as:"div",className:"chold",text:i})]},i))]})}function AT(e,n){const s=!!e.sessions?.build;return n.size==="big"?s?"Approve, and the Builder pauses after its current step. The Architect updates the design and you approve that too. Then the Builder redoes only the steps the change touches.":e.steps?"Approve, and the spec says it now. The Architect updates the design, and you approve it as usual.":"Approve, and the spec says it now. The Architect designs from the new spec.":s?"Approve, and the spec says it now. The Builder gets it at the end of its current step; the work does not stop.":"Approve, and the spec says it now. The Builder builds from the new spec."}function PT({t:e}){const n=re(),[s,r]=N.useState(!1),[i,a]=N.useState(!1),[l,c,u]=$e(e.id,"change-reason",""),h=Si(e);if(!h)return null;const m=h.status==="approved"||h.status==="designing",p=h.status==="writing"||h.status==="designing"||h.status==="building",x=(e.steps??[]).flatMap((k,b)=>k.status==="done"?[]:[b+1]),g={writing:`Change ${h.id}: the Analyst is writing it into the spec`,failed:`Change ${h.id}: the Analyst could not write it`,proposed:`Change ${h.id} to the spec`,approved:`Change ${h.id} is approved`,designing:`Change ${h.id}: the Architect is updating the design`,"design-ready":`The design update for change ${h.id}`,building:h.size==="big"?`Change ${h.id}: the Builder is redoing ${x.length===1?"step":"steps"} ${mf(x)}`:`Change ${h.id}: the Builder is making it`,done:"",declined:""}[h.status],j=(k,b,w)=>n.mutate({path:`/api/v1/tickets/${e.id}/spec-change/${k}`,body:w,done:b},{onSuccess:()=>{r(!1),a(!1),u()}});return t.jsx("div",{className:"outdated","aria-label":"Change to the spec",children:t.jsxs("div",{className:"outdated-item changecard",children:[t.jsxs("div",{className:"outdated-head",children:[t.jsx("span",{className:"ic",children:p?t.jsx(Xe,{size:15,className:"spin"}):h.status==="failed"?t.jsx(Is,{size:15}):t.jsx(Ps,{size:15})}),t.jsx("b",{children:g}),h.size&&t.jsx("span",{className:`pill ${h.size==="big"?"you":"wait"}`,children:h.size==="big"?"Big change":"Small change"})]}),t.jsxs("div",{className:"changebody",children:[t.jsx(R,{as:"p",text:h.summary??`“${h.ask}”`}),h.status==="writing"&&t.jsx("p",{className:"note",children:"The work goes on meanwhile. Nothing changes until you approve it."}),h.status==="failed"&&t.jsx(R,{as:"p",className:"note",text:h.error??""}),h.why&&(h.status==="proposed"||h.status==="approved")&&t.jsx(R,{as:"p",className:"note",text:h.why}),h.status==="proposed"&&h.parts&&t.jsx(t2,{parts:h.parts}),h.status==="proposed"&&t.jsx("p",{className:"note",children:AT(e,h)}),h.status==="approved"&&t.jsx("p",{className:"note",children:h.size==="big"?"The Builder finishes its current step, then pauses while the Architect updates the design.":"It reaches the Builder at the end of its current step. The work goes on."}),h.status==="designing"&&t.jsx("p",{className:"note",children:"The Builder paused after its step. The design update comes to you next."}),h.status==="design-ready"&&h.design&&t.jsxs(t.Fragment,{children:[h.design.summary&&t.jsx(R,{as:"p",text:h.design.summary}),t.jsx(ET,{c:h}),h.parts&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note",children:"And the spec, as you approved it:"}),t.jsx(t2,{parts:h.parts})]}),t.jsxs("p",{className:"note",children:["Approve, and the Builder redoes only ",(()=>{const k=h.design.steps.flatMap((b,w)=>b.change==="same"?[]:[w+1]);return k.length?`${k.length===1?"step":"steps"} ${mf(k)}`:"what changed"})(),". Decline, and the spec stays as it was; the Builder carries on."]})]})]}),i?t.jsxs("div",{className:"row",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:je(l),value:l,onChange:k=>c(k.target.value),placeholder:"Why take it back? (optional, it stays in the spec's record)"}),t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>j("withdraw","Withdrawn. The spec is back to how it was.",{reason:l}),children:"Withdraw"}),t.jsx("button",{className:"btn sm quiet",onClick:()=>a(!1),children:"Cancel"})]}):m?t.jsxs("div",{className:"row",children:[t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>a(!0),children:"Withdraw change"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad propose ${e.id} --withdraw`})]}):s?t.jsxs("div",{className:"row",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:je(l),value:l,onChange:k=>c(k.target.value),placeholder:"Why not? (optional, it stays in the spec's record)"}),t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>j("decline","Declined. Nothing changes.",{reason:l}),children:"Decline"}),t.jsx("button",{className:"btn sm quiet",onClick:()=>r(!1),children:"Cancel"})]}):h.status==="proposed"||h.status==="design-ready"?t.jsxs("div",{className:"row",children:[t.jsxs("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>j("approve",h.status==="design-ready"?"Approved. The Builder redoes what changed.":h.size==="big"?"Approved. The Architect updates the design next.":"Approved. The spec says it now."),children:[t.jsx(ce,{size:14,strokeWidth:2.5})," ",h.status==="design-ready"?"Approve the new design":"Approve"]}),t.jsx("button",{className:"btn sm",onClick:()=>r(!0),children:h.status==="design-ready"?"Decline the change":"Decline"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:h.status==="design-ready"?`squad approve ${e.id}`:`squad propose ${e.id} --approve`})]}):h.status==="failed"?t.jsxs("div",{className:"row",children:[t.jsx("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>j("retry","The Analyst writes it again."),children:"Try again"}),t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>j("decline","Dropped the change."),children:"Drop it"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad propose ${e.id} --retry`})]}):null]})})}function Rl({t:e,initial:n="",from:s,onClose:r}){const i=re(),[a,l,c]=$e(e.id,"propose",n),u=tr(e),h=Si(e),m=()=>{c(),r()},p=!!a.trim()&&!i.isPending,x=Me(a.trim()||"…"),g=j=>i.mutate({path:`/api/v1/tickets/${e.id}/spec-change/new-ticket`,body:{text:a,as:j},done:j==="bug"?`Reported a bug, linked to ${e.id}.`:`Made a new ticket, linked to ${e.id}.`},{onSuccess:m});return t.jsxs(Ye,{title:u?"Ask for a change":"Propose a change",icon:t.jsx(Ps,{size:16}),onClose:r,footer:t.jsxs(t.Fragment,{children:[u?t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!p,onClick:()=>g("ticket"),children:[t.jsx(jt,{size:15})," Make a new linked ticket"]}),t.jsxs("button",{className:"btn",disabled:!p,onClick:()=>g("bug"),children:[t.jsx(Js,{size:15})," Report a bug"]})]}):t.jsxs("button",{className:"btn pri",disabled:!p||!!h,onClick:()=>i.mutate({path:`/api/v1/tickets/${e.id}/spec-change`,body:{text:a,...s?{from:s}:{}},done:"Proposed. The Analyst writes it into the spec; the work goes on."},{onSuccess:m}),children:[t.jsx(Ps,{size:15})," Propose"]}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:u?`squad propose ${e.id} --as ticket ${x}`:`squad propose ${e.id} ${x}`})]}),children:[t.jsx("p",{className:"note",style:{marginBottom:10},children:u?`${e.id} is ${e.stage==="done"?"released":"accepted"}${e.release?` (${e.release})`:""}, so it only answers questions. Your change becomes a new ticket linked to it, or a bug report.`:h?`Change ${h.id} is still open. One change at a time: approve or decline it first.`:"Say what should change. The Analyst writes it into the spec, old and new, and says if it is small or big. Nothing changes until you approve it, and the work goes on meanwhile."}),t.jsx("textarea",{className:"input",rows:4,style:{width:"100%"},autoFocus:!0,dir:je(a),value:a,onChange:j=>l(j.target.value),placeholder:"For example: allow 5 bookings a day, not 3"})]})}function RT({t:e}){const[n,s]=N.useState(!1);return $u(e)?t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn sm",onClick:()=>s(!0),title:tr(e)?"Becomes a new linked ticket or a bug report":"The Analyst writes it into the spec; you approve it",children:[t.jsx(Ps,{size:13})," ",tr(e)?"Ask for a change":"Propose a change"]}),n&&t.jsx(Rl,{t:e,onClose:()=>s(!1)})]}):null}const qT={writing:"Being written",proposed:"Waits for you",approved:"Approved",designing:"Design update","design-ready":"Waits for you",building:"Being built",done:"In the spec",declined:"Declined",failed:"Not written"};function IT({t:e}){const n=[...e.changes??[]].reverse();return n.length?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["Changes to the spec · ",n.length]}),t.jsx("ul",{className:"ticketnotes",children:n.map(s=>t.jsxs("li",{...ze(s.summary??s.ask),children:[t.jsx("span",{className:`pill ${s.status==="done"?"ok":s.status==="declined"?"wait":"you"}`,children:s.decided?.withdrawn?"Withdrawn":qT[s.status]}),t.jsx(R,{className:"grow",text:`${s.id}: ${s.summary??s.ask}${s.size?` (${s.size})`:""}${s.decided?.reason?`. Why not: ${s.decided.reason}`:""}`}),t.jsx(R,{className:"note",text:s.by})]},s.id))})]}):null}function xi(e){const n=e.waiting?.kind;if(n==="proof")return!0;if(n!=="stuck")return!1;const s=e.stuck?.gate;return s==="checks"||s==="review"||s==="proof"||s==="merge"||e.stage==="test"||e.stage==="review"}function nr(e){const n=e.page?.trim()??"";if(!n)return"";const s=n.replace(/^[a-z]+:\/\/[^/]+/i,"");return s.startsWith("/")?s:`/${s}`}function Ud(e){return[...new Set([e,...e.more??[]].map(nr).filter(Boolean))]}function FT(e){return[...new Set((e.proof??[]).flatMap(Ud))]}const LT={analyst:"intake",builder:"build",tester:"tester"},zT=new Set(["implement","test","review","release","done"]),MT="Next in line";function OT(e,n=!0){const s=e.proof?.length?"tester":e.sessions?.build||zT.has(e.stage)?"builder":"analyst";return s==="analyst"||!n||e.sessions?.[LT[s]]?s:"analyst"}function $w(e){return!e.waiting&&(e.status??"").startsWith(MT)}function _T(e){return!!(e.live||e.squad)&&!e.waiting&&!e.takenOver&&!$w(e)}const DT={architect:"Architect",builder:"Builder",reviewer:"Reviewer"},BT={tickets:"is being read",specs:"is being planned",implement:"is being built",test:"is being checked",review:"is being reviewed",release:"is accepted",bugs:"is being looked into",done:"is released"};function WT(e){const n=e.id;if(e.stage==="done")return`${n} is released${e.release?` in ${e.release}`:""}`;if(e.stage==="release")return`${n} is accepted${e.release?` and goes out in ${e.release}`:""}`;if(e.takenOver?.free)return`${n} is in a conversation outside squad-kit, and the squad waits until it comes back`;if(e.takenOver)return`You have ${n}, and the squad waits until you give it back`;const s=(e.dependsOn?.length?e.dependsOn:e.dependency?.on??[]).join(", ");switch(e.waiting?.kind){case"proof":return`${n} waits for your check`;case"stuck":return xi(e)?`${n} stopped at a check and waits for your decision`:`${n} stopped and waits for your decision`;case"ask":return`${n} waits for your answer to the ${e.agentQuestion?DT[e.agentQuestion.from]:"squad"}'s question`;case"depends":return`${n} waits for ${s||"another story"} to be merged`;case"questions":return`${n} waits for your answers to the questions`;case"spec":return`${n}'s spec waits for your approval`;case"plan":return`${n}'s design waits for your approval`;case"change":return`${n} waits for you to decide on the design update`;case"release":return`${n} waits for you to release it`;case"chat":return`${n} waits while you talk it through`;case"yours":return`You have ${n}, and the squad waits until you give it back`;case"split":return`${n} waits for you to decide on the Analyst's split`}return e.dependency?.way==="wait"&&!e.dependency.started&&!e.squad?`${n} waits for ${s||"another story"} to be merged`:$w(e)?`${n} waits in the queue`:e.live||e.squad?`${n} ${BT[e.stage]}`:e.stage==="tickets"||e.stage==="bugs"?`${n} has not started yet`:`${n} is not running right now`}const ct={analyst:"Analyst",architect:"Architect",builder:"Builder",reviewer:"Reviewer",tester:"Tester"},s2={analyst:"intake",architect:"intake",builder:"build",reviewer:"review",tester:"tester"},UT={analyst:wi,architect:a1,builder:bl,reviewer:Pa,tester:d1},HT={"analyst-read":"analyst",triage:"analyst","spec-rewrite":"analyst","chat-spec":"analyst","plan-write":"architect","plan-rewrite":"architect","answered-architect":"architect","chat-design":"architect",build:"builder",unstick:"builder",fix:"builder",test:"builder","review-fix":"builder","restore-tests":"builder","update-base":"builder","proof-fix":"builder","answered-builder":"builder","chat-carry-builder":"builder",review:"reviewer","answered-reviewer":"reviewer","chat-carry-reviewer":"reviewer",proof:"tester","chat-carry-tester":"tester"};function ms({role:e,small:n,live:s}){const r=UT[e]??wi;return t.jsx("span",{className:`cav av-${e} ${n?"sm":""} ${s?"live":""}`,"aria-hidden":"true",children:t.jsx(r,{size:n?13:16,strokeWidth:2})})}function Ai({t:e,agent:n,label:s,primary:r,small:i}){const a=re();return t.jsxs("button",{className:`btn ${r?"pri":""} ${i?"sm":""}`,disabled:a.isPending,onClick:()=>a.mutate({path:`/api/v1/tickets/${e.id}/chat/start`,body:{with:n}},{onSuccess:()=>Nt.open(e.id)}),children:[t.jsx(Xn,{size:14})," ",s??`Talk to the ${ct[n]}`]})}function KT(e){return e.live&&e.squad?.phase?HT[e.squad.phase]??null:null}function Tw(e){if(e.stage==="done")return{text:`Released${e.release?` · ${e.release}`:""}`,tone:"done"};if(e.stage==="release")return{text:`Accepted${e.release?` · ready for ${e.release}`:""}`,tone:"done"};const n=er[e.stage];return e.chat?.open&&!e.chat.beside?{text:`${n} · ${e.chat.thinking?"talking":"your turn"}`,tone:"you"}:e.waiting?{text:`${n} · your turn`,tone:"you"}:{text:`${n}${e.live?" · working":""}`,tone:e.live?"work":"you"}}function Ew(e){const n=e.chat,s=ct[n.with];return n.beside?tr(e)?{kind:"released",note:"Questions only"}:xi(e)?{kind:"review",note:"Questions only"}:{kind:_T(e)?"working":"still",note:"Questions only"}:{kind:"talk",note:`The ${s} waits while you talk`}}function Aw(e){const n=e.chat,s=ct[n.with];return n.beside?null:n.with==="analyst"?{label:`${e.story?"Update":"Write"} the spec`,path:"write",done:`The Analyst is ${e.story?"updating":"writing"} the spec from your talk.`}:n.with==="architect"&&e.specApproved?{label:`${e.steps?"Update":"Write"} the design`,path:"write",done:`The Architect is ${e.steps?"updating":"writing"} the design from your talk.`}:n.with==="architect"?null:{label:"Back to work",path:"done",done:`The ${s} carries on as you agreed.`}}function z1(e){return!e.takenOver&&!(e.outside&&!e.sessions?.build)&&["implement","test","review"].includes(e.stage)}function M1({t:e}){const n=re();return t.jsxs("button",{className:"btn sm",disabled:n.isPending,title:"The squad stops. You work in the Builder's Claude Code session, then give it back.",onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/take-over`,done:"It is yours. The squad waits until you give it back."}),children:[t.jsx(bl,{size:12})," Take over"]})}function VT({t:e,size:n,onFull:s,onPanel:r}){const i=re(),[a,l]=N.useState(!1),c=e.chat,u=ct[c.with],h=Ew(e),m=Tw(e),p=c.open?Aw(e):null,x=i.isPending||!!c.thinking,g=c.with==="builder"||c.with==="reviewer"||c.with==="tester",j=(T,E)=>i.mutate({path:`/api/v1/tickets/${e.id}/chat/${T}`,done:E}),k=t.jsxs(t.Fragment,{children:[c.open&&p&&t.jsxs("button",{className:"btn pri",disabled:x,onClick:()=>j(p.path,p.done),children:[t.jsx(ce,{size:15,strokeWidth:2.5})," ",p.label]}),c.open&&h.kind==="talk"&&!g&&t.jsx("button",{className:"btn",disabled:x,onClick:()=>j("done","Done talking."),children:p?"Done, no changes":"Done"}),c.open&&h.kind==="talk"&&g&&z1(e)&&t.jsx(M1,{t:e}),c.open&&h.kind==="released"&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn",onClick:()=>l(!0),children:[t.jsx(Ej,{size:14})," New linked ticket"]}),t.jsxs("button",{className:"btn",onClick:()=>l(!0),children:[t.jsx(Js,{size:14})," Report a bug"]})]}),c.open&&h.kind==="working"&&$u(e)&&t.jsxs("button",{className:"btn",onClick:()=>l(!0),children:[t.jsx(Ps,{size:14})," Propose a change"]}),c.open&&h.kind!=="talk"&&t.jsx("button",{className:"btn",disabled:i.isPending,onClick:()=>j("done",`Done asking the ${u}.`),children:"Done"}),!c.open&&(c.beside||!e.takenOver)&&t.jsxs("button",{className:"btn",disabled:i.isPending,onClick:()=>i.mutate({path:`/api/v1/tickets/${e.id}/chat/start`,body:{with:c.with,...c.beside?{ask:!0}:{}}},{onSuccess:()=>Nt.open(e.id)}),children:[t.jsx(Xn,{size:14})," ",c.beside?`Ask the ${u} again`:`Talk to the ${u} again`]})]}),b=c.beside?WT(e):"",w=c.open&&h.kind==="working"?t.jsxs("div",{className:"cbanner work",children:[t.jsx("span",{className:"livedot","aria-hidden":"true"}),t.jsxs("span",{children:[t.jsx("b",{children:b}),e.status?t.jsxs(t.Fragment,{children:[" · ",e.status]}):null,". Asking never stops the work; a change goes through the spec."]})]}):c.open&&h.kind==="review"?t.jsx("div",{className:"cbanner done",children:t.jsxs("span",{children:[t.jsxs("b",{children:[b,"."]})," Your questions change nothing on it."," ",e.waiting?.kind==="proof"?"To ask for a change, press Something's wrong.":"To go on, pick a way out on its card."]})}):c.open&&h.kind==="released"?t.jsx("div",{className:"cbanner done",children:t.jsxs("span",{children:[t.jsxs("b",{children:[b,"."]})," Ask anything about it. A change becomes a new linked ticket or a bug report."]})}):c.open&&h.kind==="still"?t.jsx("div",{className:"cbanner done",children:t.jsxs("span",{children:[t.jsxs("b",{children:[b,"."]})," Your questions change nothing on it."]})}):null,S=a?t.jsx(Rl,{t:e,from:c.with,onClose:()=>l(!1)}):null;return n==="pop"?t.jsxs("div",{className:"cstrip",children:[t.jsx(Dr,{size:15,"aria-hidden":"true"}),t.jsx("b",{children:c.open?h.kind==="talk"&&c.with==="analyst"?`The spec ${e.story?"grows":"starts"} as you talk`:h.kind==="talk"&&c.with==="architect"&&e.specApproved?"The design grows as you talk":b||h.note:"This talk is over"}),t.jsx("span",{className:"grow"}),c.open&&p&&t.jsx("button",{className:"linkbtn go",disabled:x,onClick:()=>j(p.path,p.done),children:p.label}),c.open&&t.jsx("button",{className:"linkbtn",disabled:i.isPending,onClick:()=>j("done",h.kind==="talk"?"Done talking.":`Done asking the ${u}.`),children:p&&h.kind==="talk"&&!g?"Done, no changes":"Done"}),!c.open&&(c.beside||!e.takenOver)&&t.jsx("button",{className:"linkbtn go",disabled:i.isPending,onClick:()=>i.mutate({path:`/api/v1/tickets/${e.id}/chat/start`,body:{with:c.with,...c.beside?{ask:!0}:{}}}),children:"Talk again"}),S]}):n==="phone"?t.jsxs("div",{className:"chead-m",children:[t.jsxs("div",{className:"chead-m-row",children:[t.jsx(R,{className:"ctitle",text:e.title}),c.open&&p&&t.jsx("button",{className:"btn pri sm",disabled:x,onClick:()=>j(p.path,p.done),children:p.label}),c.open&&!p&&t.jsx("button",{className:"btn sm",disabled:i.isPending,onClick:()=>j("done","Done talking."),children:"Done"})]}),w,c.open&&h.kind==="released"&&t.jsxs("div",{className:"chead-m-row",children:[t.jsxs("button",{className:"btn sm",onClick:()=>l(!0),children:[t.jsx(Ej,{size:13})," New linked ticket"]}),t.jsxs("button",{className:"btn sm",onClick:()=>l(!0),children:[t.jsx(Js,{size:13})," Report a bug"]})]}),S]}):n==="full"?t.jsxs("div",{className:"chead-f",children:[t.jsxs("div",{className:"chead-f-row",children:[t.jsx(ms,{role:c.with,live:c.thinking}),t.jsxs("div",{className:"chead-f-t",children:[t.jsxs("div",{className:"chead-line",children:[t.jsx("span",{className:"cid",children:e.id}),t.jsx("span",{className:`cstage ${m.tone}`,children:m.text}),c.open&&t.jsx("span",{className:"cnote",children:h.note})]}),t.jsx(R,{as:"div",className:"ctitle",text:e.title})]}),t.jsx("span",{className:"grow"}),t.jsx("div",{className:"cbtns",children:k}),r&&t.jsx("button",{className:"iconbtn",onClick:r,"aria-label":"Back to its popup",title:"Back to its popup",children:t.jsx(sb,{size:16})})]}),w,S]}):t.jsxs("div",{className:"chead-p",children:[t.jsxs("div",{className:"chead-line",children:[t.jsx("span",{className:"cid",children:e.id}),t.jsx("span",{className:`cstage ${m.tone}`,children:m.text}),t.jsx("span",{className:"grow"}),c.open&&t.jsx("span",{className:"cnote",children:h.note}),s&&t.jsx("button",{className:"iconbtn sm",onClick:s,"aria-label":"Open full screen",title:"Full screen",children:t.jsx(el,{size:14})})]}),t.jsx(R,{as:"div",className:"ctitle",text:e.title}),w,t.jsx("div",{className:"cbtns",children:k}),S]})}function YT(e,n){const s={};return(e[e.length-1]===""?[...e,""]:e).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const GT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZT={};function r2(e,n){return(ZT.jsx?QT:GT).test(e)}const XT=/[ \t\n\f\r]/g;function JT(e){return typeof e=="object"?e.type==="text"?i2(e.value):!1:i2(e)}function i2(e){return e.replace(XT,"")===""}class ql{constructor(n,s,r){this.normal=s,this.property=n,r&&(this.space=r)}}ql.prototype.normal={};ql.prototype.property={};ql.prototype.space=void 0;function Pw(e,n){const s={},r={};for(const i of e)Object.assign(s,i.property),Object.assign(r,i.normal);return new ql(s,r,n)}function ff(e){return e.toLowerCase()}class bn{constructor(n,s){this.attribute=s,this.property=n}}bn.prototype.attribute="";bn.prototype.booleanish=!1;bn.prototype.boolean=!1;bn.prototype.commaOrSpaceSeparated=!1;bn.prototype.commaSeparated=!1;bn.prototype.defined=!1;bn.prototype.mustUseProperty=!1;bn.prototype.number=!1;bn.prototype.overloadedBoolean=!1;bn.prototype.property="";bn.prototype.spaceSeparated=!1;bn.prototype.space=void 0;let eE=0;const _e=Pi(),Tt=Pi(),gf=Pi(),me=Pi(),at=Pi(),pa=Pi(),Rn=Pi();function Pi(){return 2**++eE}const xf=Object.freeze(Object.defineProperty({__proto__:null,boolean:_e,booleanish:Tt,commaOrSpaceSeparated:Rn,commaSeparated:pa,number:me,overloadedBoolean:gf,spaceSeparated:at},Symbol.toStringTag,{value:"Module"})),nm=Object.keys(xf);class O1 extends bn{constructor(n,s,r,i){let a=-1;if(super(n,s),a2(this,"space",i),typeof r=="number")for(;++a<nm.length;){const l=nm[a];a2(this,nm[a],(r&xf[l])===xf[l])}}}O1.prototype.defined=!0;function a2(e,n,s){s&&(e[n]=s)}function La(e){const n={},s={};for(const[r,i]of Object.entries(e.properties)){const a=new O1(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),n[r]=a,s[ff(r)]=r,s[ff(a.attribute)]=r}return new ql(n,s,e.space)}const Rw=La({properties:{ariaActiveDescendant:null,ariaAtomic:Tt,ariaAutoComplete:null,ariaBusy:Tt,ariaChecked:Tt,ariaColCount:me,ariaColIndex:me,ariaColSpan:me,ariaControls:at,ariaCurrent:null,ariaDescribedBy:at,ariaDetails:null,ariaDisabled:Tt,ariaDropEffect:at,ariaErrorMessage:null,ariaExpanded:Tt,ariaFlowTo:at,ariaGrabbed:Tt,ariaHasPopup:null,ariaHidden:Tt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:at,ariaLevel:me,ariaLive:null,ariaModal:Tt,ariaMultiLine:Tt,ariaMultiSelectable:Tt,ariaOrientation:null,ariaOwns:at,ariaPlaceholder:null,ariaPosInSet:me,ariaPressed:Tt,ariaReadOnly:Tt,ariaRelevant:null,ariaRequired:Tt,ariaRoleDescription:at,ariaRowCount:me,ariaRowIndex:me,ariaRowSpan:me,ariaSelected:Tt,ariaSetSize:me,ariaSort:null,ariaValueMax:me,ariaValueMin:me,ariaValueNow:me,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function qw(e,n){return n in e?e[n]:n}function Iw(e,n){return qw(e,n.toLowerCase())}const tE=La({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:pa,acceptCharset:at,accessKey:at,action:null,allow:null,allowFullScreen:_e,allowPaymentRequest:_e,allowUserMedia:_e,alt:null,as:null,async:_e,autoCapitalize:null,autoComplete:at,autoFocus:_e,autoPlay:_e,blocking:at,capture:null,charSet:null,checked:_e,cite:null,className:at,cols:me,colSpan:null,content:null,contentEditable:Tt,controls:_e,controlsList:at,coords:me|pa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:_e,defer:_e,dir:null,dirName:null,disabled:_e,download:gf,draggable:Tt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:_e,formTarget:null,headers:at,height:me,hidden:gf,high:me,href:null,hrefLang:null,htmlFor:at,httpEquiv:at,id:null,imageSizes:null,imageSrcSet:null,inert:_e,inputMode:null,integrity:null,is:null,isMap:_e,itemId:null,itemProp:at,itemRef:at,itemScope:_e,itemType:at,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:_e,low:me,manifest:null,max:null,maxLength:me,media:null,method:null,min:null,minLength:me,multiple:_e,muted:_e,name:null,nonce:null,noModule:_e,noValidate:_e,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:_e,optimum:me,pattern:null,ping:at,placeholder:null,playsInline:_e,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:_e,referrerPolicy:null,rel:at,required:_e,reversed:_e,rows:me,rowSpan:me,sandbox:at,scope:null,scoped:_e,seamless:_e,selected:_e,shadowRootClonable:_e,shadowRootDelegatesFocus:_e,shadowRootMode:null,shape:null,size:me,sizes:null,slot:null,span:me,spellCheck:Tt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:me,step:null,style:null,tabIndex:me,target:null,title:null,translate:null,type:null,typeMustMatch:_e,useMap:null,value:Tt,width:me,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:at,axis:null,background:null,bgColor:null,border:me,borderColor:null,bottomMargin:me,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:_e,declare:_e,event:null,face:null,frame:null,frameBorder:null,hSpace:me,leftMargin:me,link:null,longDesc:null,lowSrc:null,marginHeight:me,marginWidth:me,noResize:_e,noHref:_e,noShade:_e,noWrap:_e,object:null,profile:null,prompt:null,rev:null,rightMargin:me,rules:null,scheme:null,scrolling:Tt,standby:null,summary:null,text:null,topMargin:me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:_e,disableRemotePlayback:_e,prefix:null,property:null,results:me,security:null,unselectable:null},space:"html",transform:Iw}),nE=La({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Rn,accentHeight:me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:me,amplitude:me,arabicForm:null,ascent:me,attributeName:null,attributeType:null,azimuth:me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:me,by:null,calcMode:null,capHeight:me,className:at,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:me,diffuseConstant:me,direction:null,display:null,dur:null,divisor:me,dominantBaseline:null,download:_e,dx:null,dy:null,edgeMode:null,editable:null,elevation:me,enableBackground:null,end:null,event:null,exponent:me,externalResourcesRequired:null,fill:null,fillOpacity:me,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:pa,g2:pa,glyphName:pa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:me,horizOriginX:me,horizOriginY:me,id:null,ideographic:me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:me,k:me,k1:me,k2:me,k3:me,k4:me,kernelMatrix:Rn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:me,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:me,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:me,overlineThickness:me,paintOrder:null,panose1:null,path:null,pathLength:me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:at,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:me,pointsAtY:me,pointsAtZ:me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Rn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Rn,rev:Rn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Rn,requiredFeatures:Rn,requiredFonts:Rn,requiredFormats:Rn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:me,specularExponent:me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:me,strikethroughThickness:me,string:null,stroke:null,strokeDashArray:Rn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:me,strokeOpacity:me,strokeWidth:null,style:null,surfaceScale:me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Rn,tabIndex:me,tableValues:null,target:null,targetX:me,targetY:me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Rn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:me,underlineThickness:me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:me,values:null,vAlphabetic:me,vMathematical:me,vectorEffect:null,vHanging:me,vIdeographic:me,version:null,vertAdvY:me,vertOriginX:me,vertOriginY:me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qw}),Fw=La({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),Lw=La({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Iw}),zw=La({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),sE={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},rE=/[A-Z]/g,o2=/-[a-z]/g,iE=/^data[-\w.:]+$/i;function aE(e,n){const s=ff(n);let r=n,i=bn;if(s in e.normal)return e.property[e.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&iE.test(n)){if(n.charAt(4)==="-"){const a=n.slice(5).replace(o2,lE);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=n.slice(4);if(!o2.test(a)){let l=a.replace(rE,oE);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}i=O1}return new i(r,n)}function oE(e){return"-"+e.toLowerCase()}function lE(e){return e.charAt(1).toUpperCase()}const cE=Pw([Rw,tE,Fw,Lw,zw],"html"),_1=Pw([Rw,nE,Fw,Lw,zw],"svg");function dE(e){return e.join(" ").trim()}var sa={},sm,l2;function uE(){if(l2)return sm;l2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,s=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,u=`
651
+ `,h="/",m="*",p="",x="comment",g="declaration";function j(b,w){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];w=w||{};var S=1,T=1;function E(M){var Y=M.match(n);Y&&(S+=Y.length);var ae=M.lastIndexOf(u);T=~ae?M.length-ae:T+M.length}function z(){var M={line:S,column:T};return function(Y){return Y.position=new $(M),W(),Y}}function $(M){this.start=M,this.end={line:S,column:T},this.source=w.source}$.prototype.content=b;function P(M){var Y=new Error(w.source+":"+S+":"+T+": "+M);if(Y.reason=M,Y.filename=w.source,Y.line=S,Y.column=T,Y.source=b,!w.silent)throw Y}function L(M){var Y=M.exec(b);if(Y){var ae=Y[0];return E(ae),b=b.slice(ae.length),Y}}function W(){L(s)}function F(M){var Y;for(M=M||[];Y=U();)Y!==!1&&M.push(Y);return M}function U(){var M=z();if(!(h!=b.charAt(0)||m!=b.charAt(1))){for(var Y=2;p!=b.charAt(Y)&&(m!=b.charAt(Y)||h!=b.charAt(Y+1));)++Y;if(Y+=2,p===b.charAt(Y-1))return P("End of comment missing");var ae=b.slice(2,Y-2);return T+=2,E(ae),b=b.slice(Y),T+=2,M({type:x,comment:ae})}}function I(){var M=z(),Y=L(r);if(Y){if(U(),!L(i))return P("property missing ':'");var ae=L(a),H=M({type:g,property:k(Y[0].replace(e,p)),value:ae?k(ae[0].replace(e,p)):p});return L(l),H}}function D(){var M=[];F(M);for(var Y;Y=I();)Y!==!1&&(M.push(Y),F(M));return M}return W(),D()}function k(b){return b?b.replace(c,p):p}return sm=j,sm}var c2;function hE(){if(c2)return sa;c2=1;var e=sa&&sa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(sa,"__esModule",{value:!0}),sa.default=s;const n=e(uE());function s(r,i){let a=null;if(!r||typeof r!="string")return a;const l=(0,n.default)(r),c=typeof i=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:h,value:m}=u;c?i(h,m,u):m&&(a=a||{},a[h]=m)}),a}return sa}var Eo={},d2;function pE(){if(d2)return Eo;d2=1,Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,s=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(h){return!h||s.test(h)||e.test(h)},l=function(h,m){return m.toUpperCase()},c=function(h,m){return"".concat(m,"-")},u=function(h,m){return m===void 0&&(m={}),a(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(i,c):h=h.replace(r,c),h.replace(n,l))};return Eo.camelCase=u,Eo}var Ao,u2;function mE(){if(u2)return Ao;u2=1;var e=Ao&&Ao.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(hE()),s=pE();function r(i,a){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(c,u){c&&u&&(l[(0,s.camelCase)(c,a)]=u)}),l}return r.default=r,Ao=r,Ao}var fE=mE();const gE=Uf(fE),Mw=Ow("end"),D1=Ow("start");function Ow(e){return n;function n(s){const r=s&&s.position&&s.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function xE(e){const n=D1(e),s=Mw(e);if(n&&s)return{start:n,end:s}}function Oo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?h2(e.position):"start"in e||"end"in e?h2(e):"line"in e||"column"in e?yf(e):""}function yf(e){return p2(e&&e.line)+":"+p2(e&&e.column)}function h2(e){return yf(e&&e.start)+"-"+yf(e&&e.end)}function p2(e){return e&&typeof e=="number"?e:1}class nn extends Error{constructor(n,s,r){super(),typeof s=="string"&&(r=s,s=void 0);let i="",a={},l=!1;if(s&&("line"in s&&"column"in s?a={place:s}:"start"in s&&"end"in s?a={place:s}:"type"in s?a={ancestors:[s],place:s.position}:a={...s}),typeof n=="string"?i=n:!a.cause&&n&&(l=!0,i=n.message,a.cause=n),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=Oo(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=l&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}nn.prototype.file="";nn.prototype.name="";nn.prototype.reason="";nn.prototype.message="";nn.prototype.stack="";nn.prototype.column=void 0;nn.prototype.line=void 0;nn.prototype.ancestors=void 0;nn.prototype.cause=void 0;nn.prototype.fatal=void 0;nn.prototype.place=void 0;nn.prototype.ruleId=void 0;nn.prototype.source=void 0;const B1={}.hasOwnProperty,yE=new Map,jE=/[A-Z]/g,kE=new Set(["table","tbody","thead","tfoot","tr"]),vE=new Set(["td","th"]),_w="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bE(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=AE(s,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=EE(s,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?_1:cE,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},a=Dw(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Dw(e,n,s){if(n.type==="element")return wE(e,n,s);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return NE(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return CE(e,n,s);if(n.type==="mdxjsEsm")return SE(e,n);if(n.type==="root")return $E(e,n,s);if(n.type==="text")return TE(e,n)}function wE(e,n,s){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=_1,e.schema=i),e.ancestors.push(n);const a=Ww(e,n.tagName,!1),l=PE(e,n);let c=U1(e,n);return kE.has(n.tagName)&&(c=c.filter(function(u){return typeof u=="string"?!JT(u):!0})),Bw(e,l,a,n),W1(l,c),e.ancestors.pop(),e.schema=r,e.create(n,a,l,s)}function NE(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}cl(e,n.position)}function SE(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);cl(e,n.position)}function CE(e,n,s){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=_1,e.schema=i),e.ancestors.push(n);const a=n.name===null?e.Fragment:Ww(e,n.name,!0),l=RE(e,n),c=U1(e,n);return Bw(e,l,a,n),W1(l,c),e.ancestors.pop(),e.schema=r,e.create(n,a,l,s)}function $E(e,n,s){const r={};return W1(r,U1(e,n)),e.create(n,e.Fragment,r,s)}function TE(e,n){return n.value}function Bw(e,n,s,r){typeof s!="string"&&s!==e.Fragment&&e.passNode&&(n.node=r)}function W1(e,n){if(n.length>0){const s=n.length>1?n:n[0];s&&(e.children=s)}}function EE(e,n,s){return r;function r(i,a,l,c){const h=Array.isArray(l.children)?s:n;return c?h(a,l,c):h(a,l)}}function AE(e,n){return s;function s(r,i,a,l){const c=Array.isArray(a.children),u=D1(r);return n(i,a,l,c,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function PE(e,n){const s={};let r,i;for(i in n.properties)if(i!=="children"&&B1.call(n.properties,i)){const a=qE(e,i,n.properties[i]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&vE.has(n.tagName)?r=c:s[l]=c}}if(r){const a=s.style||(s.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return s}function RE(e,n){const s={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const l=a.expression;l.type;const c=l.properties[0];c.type,Object.assign(s,e.evaluater.evaluateExpression(c.argument))}else cl(e,n.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else cl(e,n.position);else a=r.value===null?!0:r.value;s[i]=a}return s}function U1(e,n){const s=[];let r=-1;const i=e.passKeys?new Map:yE;for(;++r<n.children.length;){const a=n.children[r];let l;if(e.passKeys){const u=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(u){const h=i.get(u)||0;l=u+"-"+h,i.set(u,h+1)}}const c=Dw(e,a,l);c!==void 0&&s.push(c)}return s}function qE(e,n,s){const r=aE(e.schema,n);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=r.commaSeparated?YT(s):dE(s)),r.property==="style"){let i=typeof s=="object"?s:IE(e,String(s));return e.stylePropertyNameCase==="css"&&(i=FE(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?sE[r.property]||r.property:r.attribute,s]}}function IE(e,n){try{return gE(n,{reactCompat:!0})}catch(s){if(e.ignoreInvalidStyle)return{};const r=s,i=new nn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=_w+"#cannot-parse-style-attribute",i}}function Ww(e,n,s){let r;if(!s)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let a=-1,l;for(;++a<i.length;){const c=r2(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=l}else r=r2(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return B1.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);cl(e)}function cl(e,n){const s=new nn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=_w+"#cannot-handle-mdx-estrees-without-createevaluater",s}function FE(e){const n={};let s;for(s in e)B1.call(e,s)&&(n[LE(s)]=e[s]);return n}function LE(e){let n=e.replace(jE,zE);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function zE(e){return"-"+e.toLowerCase()}const rm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},ME={};function H1(e,n){const s=ME,r=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,i=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return Uw(e,r,i)}function Uw(e,n,s){if(OE(e)){if("value"in e)return e.type==="html"&&!s?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return m2(e.children,n,s)}return Array.isArray(e)?m2(e,n,s):""}function m2(e,n,s){const r=[];let i=-1;for(;++i<e.length;)r[i]=Uw(e[i],n,s);return r.join("")}function OE(e){return!!(e&&typeof e=="object")}const f2=document.createElement("i");function K1(e){const n="&"+e+";";f2.innerHTML=n;const s=f2.textContent;return s.charCodeAt(s.length-1)===59&&e!=="semi"||s===n?!1:s}function Ln(e,n,s,r){const i=e.length;let a=0,l;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,s=s>0?s:0,r.length<1e4)l=Array.from(r),l.unshift(n,s),e.splice(...l);else for(s&&e.splice(n,s);a<r.length;)l=r.slice(a,a+1e4),l.unshift(n,0),e.splice(...l),a+=1e4,n+=1e4}function Qn(e,n){return e.length>0?(Ln(e,e.length,0,n),e):n}const g2={}.hasOwnProperty;function Hw(e){const n={};let s=-1;for(;++s<e.length;)_E(n,e[s]);return n}function _E(e,n){let s;for(s in n){const i=(g2.call(e,s)?e[s]:void 0)||(e[s]={}),a=n[s];let l;if(a)for(l in a){g2.call(i,l)||(i[l]=[]);const c=a[l];DE(i[l],Array.isArray(c)?c:c?[c]:[])}}}function DE(e,n){let s=-1;const r=[];for(;++s<n.length;)(n[s].add==="after"?e:r).push(n[s]);Ln(e,0,0,r)}function Kw(e,n){const s=Number.parseInt(e,n);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function fs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const cn=Ur(/[A-Za-z]/),Qt=Ur(/[\dA-Za-z]/),BE=Ur(/[#-'*+\--9=?A-Z^-~]/);function Hd(e){return e!==null&&(e<32||e===127)}const jf=Ur(/\d/),WE=Ur(/[\dA-Fa-f]/),UE=Ur(/[!-/:-@[-`{-~]/);function qe(e){return e!==null&&e<-2}function rt(e){return e!==null&&(e<0||e===32)}function We(e){return e===-2||e===-1||e===32}const Tu=Ur(/\p{P}|\p{S}/u),yi=Ur(/\s/);function Ur(e){return n;function n(s){return s!==null&&s>-1&&e.test(String.fromCharCode(s))}}function za(e){const n=[];let s=-1,r=0,i=0;for(;++s<e.length;){const a=e.charCodeAt(s);let l="";if(a===37&&Qt(e.charCodeAt(s+1))&&Qt(e.charCodeAt(s+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(s+1);a<56320&&c>56319&&c<57344?(l=String.fromCharCode(a,c),i=1):l="�"}else l=String.fromCharCode(a);l&&(n.push(e.slice(r,s),encodeURIComponent(l)),r=s+i+1,l=""),i&&(s+=i,i=0)}return n.join("")+e.slice(r)}function Ve(e,n,s,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(u){return We(u)?(e.enter(s),c(u)):n(u)}function c(u){return We(u)&&a++<i?(e.consume(u),c):(e.exit(s),n(u))}}const HE={tokenize:KE};function KE(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let s;return n;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Ve(e,n,"linePrefix")}function i(c){return e.enter("paragraph"),a(c)}function a(c){const u=e.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=u),s=u,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return qe(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const VE={tokenize:YE},x2={tokenize:GE};function YE(e){const n=this,s=[];let r=0,i,a,l;return c;function c(T){if(r<s.length){const E=s[r];return n.containerState=E[1],e.attempt(E[0].continuation,u,h)(T)}return h(T)}function u(T){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&S();const E=n.events.length;let z=E,$;for(;z--;)if(n.events[z][0]==="exit"&&n.events[z][1].type==="chunkFlow"){$=n.events[z][1].end;break}w(r);let P=E;for(;P<n.events.length;)n.events[P][1].end={...$},P++;return Ln(n.events,z+1,0,n.events.slice(E)),n.events.length=P,h(T)}return c(T)}function h(T){if(r===s.length){if(!i)return x(T);if(i.currentConstruct&&i.currentConstruct.concrete)return j(T);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(x2,m,p)(T)}function m(T){return i&&S(),w(r),x(T)}function p(T){return n.parser.lazy[n.now().line]=r!==s.length,l=n.now().offset,j(T)}function x(T){return n.containerState={},e.attempt(x2,g,j)(T)}function g(T){return r++,s.push([n.currentConstruct,n.containerState]),x(T)}function j(T){if(T===null){i&&S(),w(0),e.consume(T);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),k(T)}function k(T){if(T===null){b(e.exit("chunkFlow"),!0),w(0),e.consume(T);return}return qe(T)?(e.consume(T),b(e.exit("chunkFlow")),r=0,n.interrupt=void 0,c):(e.consume(T),k)}function b(T,E){const z=n.sliceStream(T);if(E&&z.push(null),T.previous=a,a&&(a.next=T),a=T,i.defineSkip(T.start),i.write(z),n.parser.lazy[T.start.line]){let $=i.events.length;for(;$--;)if(i.events[$][1].start.offset<l&&(!i.events[$][1].end||i.events[$][1].end.offset>l))return;const P=n.events.length;let L=P,W,F;for(;L--;)if(n.events[L][0]==="exit"&&n.events[L][1].type==="chunkFlow"){if(W){F=n.events[L][1].end;break}W=!0}for(w(r),$=P;$<n.events.length;)n.events[$][1].end={...F},$++;Ln(n.events,L+1,0,n.events.slice(P)),n.events.length=$}}function w(T){let E=s.length;for(;E-- >T;){const z=s[E];n.containerState=z[1],z[0].exit.call(n,e)}s.length=T}function S(){i.write([null]),a=void 0,i=void 0,n.containerState._closeFlow=void 0}}function GE(e,n,s){return Ve(e,e.attempt(this.parser.constructs.document,n,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wa(e){if(e===null||rt(e)||yi(e))return 1;if(Tu(e))return 2}function Eu(e,n,s){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(n=a(n,s),r.push(a))}return n}const kf={name:"attention",resolveAll:QE,tokenize:ZE};function QE(e,n){let s=-1,r,i,a,l,c,u,h,m;for(;++s<e.length;)if(e[s][0]==="enter"&&e[s][1].type==="attentionSequence"&&e[s][1]._close){for(r=s;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[s][1]).charCodeAt(0)){if((e[r][1]._close||e[s][1]._open)&&(e[s][1].end.offset-e[s][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[s][1].end.offset-e[s][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[s][1].end.offset-e[s][1].start.offset>1?2:1;const p={...e[r][1].end},x={...e[s][1].start};y2(p,-u),y2(x,u),l={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},c={type:u>1?"strongSequence":"emphasisSequence",start:{...e[s][1].start},end:x},a={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[s][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[s][1].start={...c.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=Qn(h,[["enter",e[r][1],n],["exit",e[r][1],n]])),h=Qn(h,[["enter",i,n],["enter",l,n],["exit",l,n],["enter",a,n]]),h=Qn(h,Eu(n.parser.constructs.insideSpan.null,e.slice(r+1,s),n)),h=Qn(h,[["exit",a,n],["enter",c,n],["exit",c,n],["exit",i,n]]),e[s][1].end.offset-e[s][1].start.offset?(m=2,h=Qn(h,[["enter",e[s][1],n],["exit",e[s][1],n]])):m=0,Ln(e,r-1,s-r+3,h),s=r+h.length-m-2;break}}for(s=-1;++s<e.length;)e[s][1].type==="attentionSequence"&&(e[s][1].type="data");return e}function ZE(e,n){const s=this.parser.constructs.attentionMarkers.null,r=this.previous,i=wa(r);let a;return l;function l(u){return a=u,e.enter("attentionSequence"),c(u)}function c(u){if(u===a)return e.consume(u),c;const h=e.exit("attentionSequence"),m=wa(u),p=!m||m===2&&i||s.includes(u),x=!i||i===2&&m||s.includes(r);return h._open=!!(a===42?p:p&&(i||!x)),h._close=!!(a===42?x:x&&(m||!p)),n(u)}}function y2(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const XE={name:"autolink",tokenize:JE};function JE(e,n,s){let r=0;return i;function i(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(g){return cn(g)?(e.consume(g),l):g===64?s(g):h(g)}function l(g){return g===43||g===45||g===46||Qt(g)?(r=1,c(g)):h(g)}function c(g){return g===58?(e.consume(g),r=0,u):(g===43||g===45||g===46||Qt(g))&&r++<32?(e.consume(g),c):(r=0,h(g))}function u(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),n):g===null||g===32||g===60||Hd(g)?s(g):(e.consume(g),u)}function h(g){return g===64?(e.consume(g),m):BE(g)?(e.consume(g),h):s(g)}function m(g){return Qt(g)?p(g):s(g)}function p(g){return g===46?(e.consume(g),r=0,m):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),n):x(g)}function x(g){if((g===45||Qt(g))&&r++<63){const j=g===45?x:p;return e.consume(g),j}return s(g)}}const Il={partial:!0,tokenize:eA};function eA(e,n,s){return r;function r(a){return We(a)?Ve(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||qe(a)?n(a):s(a)}}const Vw={continuation:{tokenize:nA},exit:sA,name:"blockQuote",tokenize:tA};function tA(e,n,s){const r=this;return i;function i(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return s(l)}function a(l){return We(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function nA(e,n,s){const r=this;return i;function i(l){return We(l)?Ve(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(Vw,n,s)(l)}}function sA(e){e.exit("blockQuote")}const Yw={name:"characterEscape",tokenize:rA};function rA(e,n,s){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return UE(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):s(a)}}const Gw={name:"characterReference",tokenize:iA};function iA(e,n,s){const r=this;let i=0,a,l;return c;function c(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),u}function u(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),a=31,l=Qt,m(p))}function h(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=WE,m):(e.enter("characterReferenceValue"),a=7,l=jf,m(p))}function m(p){if(p===59&&i){const x=e.exit("characterReferenceValue");return l===Qt&&!K1(r.sliceSerialize(x))?s(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(p)&&i++<a?(e.consume(p),m):s(p)}}const j2={partial:!0,tokenize:oA},k2={concrete:!0,name:"codeFenced",tokenize:aA};function aA(e,n,s){const r=this,i={partial:!0,tokenize:z};let a=0,l=0,c;return u;function u($){return h($)}function h($){const P=r.events[r.events.length-1];return a=P&&P[1].type==="linePrefix"?P[2].sliceSerialize(P[1],!0).length:0,c=$,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m($)}function m($){return $===c?(l++,e.consume($),m):l<3?s($):(e.exit("codeFencedFenceSequence"),We($)?Ve(e,p,"whitespace")($):p($))}function p($){return $===null||qe($)?(e.exit("codeFencedFence"),r.interrupt?n($):e.check(j2,k,E)($)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x($))}function x($){return $===null||qe($)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p($)):We($)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ve(e,g,"whitespace")($)):$===96&&$===c?s($):(e.consume($),x)}function g($){return $===null||qe($)?p($):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),j($))}function j($){return $===null||qe($)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p($)):$===96&&$===c?s($):(e.consume($),j)}function k($){return e.attempt(i,E,b)($)}function b($){return e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),w}function w($){return a>0&&We($)?Ve(e,S,"linePrefix",a+1)($):S($)}function S($){return $===null||qe($)?e.check(j2,k,E)($):(e.enter("codeFlowValue"),T($))}function T($){return $===null||qe($)?(e.exit("codeFlowValue"),S($)):(e.consume($),T)}function E($){return e.exit("codeFenced"),n($)}function z($,P,L){let W=0;return F;function F(Y){return $.enter("lineEnding"),$.consume(Y),$.exit("lineEnding"),U}function U(Y){return $.enter("codeFencedFence"),We(Y)?Ve($,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):I(Y)}function I(Y){return Y===c?($.enter("codeFencedFenceSequence"),D(Y)):L(Y)}function D(Y){return Y===c?(W++,$.consume(Y),D):W>=l?($.exit("codeFencedFenceSequence"),We(Y)?Ve($,M,"whitespace")(Y):M(Y)):L(Y)}function M(Y){return Y===null||qe(Y)?($.exit("codeFencedFence"),P(Y)):L(Y)}}}function oA(e,n,s){const r=this;return i;function i(l){return l===null?s(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?s(l):n(l)}}const im={name:"codeIndented",tokenize:cA},lA={partial:!0,tokenize:dA};function cA(e,n,s){const r=this;return i;function i(h){return e.enter("codeIndented"),Ve(e,a,"linePrefix",5)(h)}function a(h){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(h):s(h)}function l(h){return h===null?u(h):qe(h)?e.attempt(lA,l,u)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||qe(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),c)}function u(h){return e.exit("codeIndented"),n(h)}}function dA(e,n,s){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?s(l):qe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):Ve(e,a,"linePrefix",5)(l)}function a(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?n(l):qe(l)?i(l):s(l)}}const uA={name:"codeText",previous:pA,resolve:hA,tokenize:mA};function hA(e){let n=e.length-4,s=3,r,i;if((e[s][1].type==="lineEnding"||e[s][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=s;++r<n;)if(e[r][1].type==="codeTextData"){e[s][1].type="codeTextPadding",e[n][1].type="codeTextPadding",s+=2,n-=2;break}}for(r=s-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function pA(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function mA(e,n,s){let r=0,i,a;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),c(p)}function c(p){return p===96?(e.consume(p),r++,c):(e.exit("codeTextSequence"),u(p))}function u(p){return p===null?s(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),u):p===96?(a=e.enter("codeTextSequence"),i=0,m(p)):qe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||qe(p)?(e.exit("codeTextData"),u(p)):(e.consume(p),h)}function m(p){return p===96?(e.consume(p),i++,m):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(p)):(a.type="codeTextData",h(p))}}class fA{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,s){const r=s??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,s,r){const i=s||0;this.setCursor(Math.trunc(n));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Po(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Po(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Po(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const s=this.left.splice(n,Number.POSITIVE_INFINITY);Po(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Po(this.left,s.reverse())}}}function Po(e,n){let s=0;if(n.length<1e4)e.push(...n);else for(;s<n.length;)e.push(...n.slice(s,s+1e4)),s+=1e4}function Qw(e){const n={};let s=-1,r,i,a,l,c,u,h;const m=new fA(e);for(;++s<m.length;){for(;s in n;)s=n[s];if(r=m.get(s),s&&r[1].type==="chunkFlow"&&m.get(s-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,a=0,a<u.length&&u[a][1].type==="lineEndingBlank"&&(a+=2),a<u.length&&u[a][1].type==="content"))for(;++a<u.length&&u[a][1].type!=="content";)u[a][1].type==="chunkText"&&(u[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,gA(m,s)),s=n[s],h=!0);else if(r[1]._container){for(a=s,i=void 0;a--;)if(l=m.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(m.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...m.get(i)[1].start},c=m.slice(i,s),c.unshift(r),m.splice(i,s-i+1,c))}}return Ln(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function gA(e,n){const s=e.get(n)[1],r=e.get(n)[2];let i=n-1;const a=[];let l=s._tokenizer;l||(l=r.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,u=[],h={};let m,p,x=-1,g=s,j=0,k=0;const b=[k];for(;g;){for(;e.get(++i)[1]!==g;);a.push(i),g._tokenizer||(m=r.sliceStream(g),g.next||m.push(null),p&&l.defineSkip(g.start),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=g,g=g.next}for(g=s;++x<c.length;)c[x][0]==="exit"&&c[x-1][0]==="enter"&&c[x][1].type===c[x-1][1].type&&c[x][1].start.line!==c[x][1].end.line&&(k=x+1,b.push(k),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(l.events=[],g?(g._tokenizer=void 0,g.previous=void 0):b.pop(),x=b.length;x--;){const w=c.slice(b[x],b[x+1]),S=a.pop();u.push([S,S+w.length-1]),e.splice(S,2,w)}for(u.reverse(),x=-1;++x<u.length;)h[j+u[x][0]]=j+u[x][1],j+=u[x][1]-u[x][0]-1;return h}const xA={resolve:jA,tokenize:kA},yA={partial:!0,tokenize:vA};function jA(e){return Qw(e),e}function kA(e,n){let s;return r;function r(c){return e.enter("content"),s=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?a(c):qe(c)?e.check(yA,l,a)(c):(e.consume(c),i)}function a(c){return e.exit("chunkContent"),e.exit("content"),n(c)}function l(c){return e.consume(c),e.exit("chunkContent"),s.next=e.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,i}}function vA(e,n,s){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Ve(e,a,"linePrefix")}function a(l){if(l===null||qe(l))return s(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?n(l):e.interrupt(r.parser.constructs.flow,s,n)(l)}}function Zw(e,n,s,r,i,a,l,c,u){const h=u||Number.POSITIVE_INFINITY;let m=0;return p;function p(w){return w===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(w),e.exit(a),x):w===null||w===32||w===41||Hd(w)?s(w):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),k(w))}function x(w){return w===62?(e.enter(a),e.consume(w),e.exit(a),e.exit(i),e.exit(r),n):(e.enter(c),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===62?(e.exit("chunkString"),e.exit(c),x(w)):w===null||w===60||qe(w)?s(w):(e.consume(w),w===92?j:g)}function j(w){return w===60||w===62||w===92?(e.consume(w),g):g(w)}function k(w){return!m&&(w===null||w===41||rt(w))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),n(w)):m<h&&w===40?(e.consume(w),m++,k):w===41?(e.consume(w),m--,k):w===null||w===32||w===40||Hd(w)?s(w):(e.consume(w),w===92?b:k)}function b(w){return w===40||w===41||w===92?(e.consume(w),k):k(w)}}function Xw(e,n,s,r,i,a){const l=this;let c=0,u;return h;function h(g){return e.enter(r),e.enter(i),e.consume(g),e.exit(i),e.enter(a),m}function m(g){return c>999||g===null||g===91||g===93&&!u||g===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?s(g):g===93?(e.exit(a),e.enter(i),e.consume(g),e.exit(i),e.exit(r),n):qe(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===null||g===91||g===93||qe(g)||c++>999?(e.exit("chunkString"),m(g)):(e.consume(g),u||(u=!We(g)),g===92?x:p)}function x(g){return g===91||g===92||g===93?(e.consume(g),c++,p):p(g)}}function Jw(e,n,s,r,i,a){let l;return c;function c(x){return x===34||x===39||x===40?(e.enter(r),e.enter(i),e.consume(x),e.exit(i),l=x===40?41:x,u):s(x)}function u(x){return x===l?(e.enter(i),e.consume(x),e.exit(i),e.exit(r),n):(e.enter(a),h(x))}function h(x){return x===l?(e.exit(a),u(l)):x===null?s(x):qe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Ve(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===l||x===null||qe(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?p:m)}function p(x){return x===l||x===92?(e.consume(x),m):m(x)}}function _o(e,n){let s;return r;function r(i){return qe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),s=!0,r):We(i)?Ve(e,r,s?"linePrefix":"lineSuffix")(i):n(i)}}const bA={name:"definition",tokenize:NA},wA={partial:!0,tokenize:SA};function NA(e,n,s){const r=this;let i;return a;function a(g){return e.enter("definition"),l(g)}function l(g){return Xw.call(r,e,c,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function c(g){return i=fs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),u):s(g)}function u(g){return rt(g)?_o(e,h)(g):h(g)}function h(g){return Zw(e,m,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function m(g){return e.attempt(wA,p,p)(g)}function p(g){return We(g)?Ve(e,x,"whitespace")(g):x(g)}function x(g){return g===null||qe(g)?(e.exit("definition"),r.parser.defined.push(i),n(g)):s(g)}}function SA(e,n,s){return r;function r(c){return rt(c)?_o(e,i)(c):s(c)}function i(c){return Jw(e,a,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return We(c)?Ve(e,l,"whitespace")(c):l(c)}function l(c){return c===null||qe(c)?n(c):s(c)}}const CA={name:"hardBreakEscape",tokenize:$A};function $A(e,n,s){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return qe(a)?(e.exit("hardBreakEscape"),n(a)):s(a)}}const TA={name:"headingAtx",resolve:EA,tokenize:AA};function EA(e,n){let s=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),s-2>r&&e[s][1].type==="whitespace"&&(s-=2),e[s][1].type==="atxHeadingSequence"&&(r===s-1||s-4>r&&e[s-2][1].type==="whitespace")&&(s-=r+1===s?2:4),s>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[s][1].end},a={type:"chunkText",start:e[r][1].start,end:e[s][1].end,contentType:"text"},Ln(e,r,s-r+1,[["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n]])),e}function AA(e,n,s){let r=0;return i;function i(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||rt(m)?(e.exit("atxHeadingSequence"),c(m)):s(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),u(m)):m===null||qe(m)?(e.exit("atxHeading"),n(m)):We(m)?Ve(e,c,"whitespace")(m):(e.enter("atxHeadingText"),h(m))}function u(m){return m===35?(e.consume(m),u):(e.exit("atxHeadingSequence"),c(m))}function h(m){return m===null||m===35||rt(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),h)}}const PA=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],v2=["pre","script","style","textarea"],RA={concrete:!0,name:"htmlFlow",resolveTo:FA,tokenize:LA},qA={partial:!0,tokenize:MA},IA={partial:!0,tokenize:zA};function FA(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function LA(e,n,s){const r=this;let i,a,l,c,u;return h;function h(O){return m(O)}function m(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),p}function p(O){return O===33?(e.consume(O),x):O===47?(e.consume(O),a=!0,k):O===63?(e.consume(O),i=3,r.interrupt?n:q):cn(O)?(e.consume(O),l=String.fromCharCode(O),b):s(O)}function x(O){return O===45?(e.consume(O),i=2,g):O===91?(e.consume(O),i=5,c=0,j):cn(O)?(e.consume(O),i=4,r.interrupt?n:q):s(O)}function g(O){return O===45?(e.consume(O),r.interrupt?n:q):s(O)}function j(O){const ke="CDATA[";return O===ke.charCodeAt(c++)?(e.consume(O),c===ke.length?r.interrupt?n:I:j):s(O)}function k(O){return cn(O)?(e.consume(O),l=String.fromCharCode(O),b):s(O)}function b(O){if(O===null||O===47||O===62||rt(O)){const ke=O===47,pe=l.toLowerCase();return!ke&&!a&&v2.includes(pe)?(i=1,r.interrupt?n(O):I(O)):PA.includes(l.toLowerCase())?(i=6,ke?(e.consume(O),w):r.interrupt?n(O):I(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?s(O):a?S(O):T(O))}return O===45||Qt(O)?(e.consume(O),l+=String.fromCharCode(O),b):s(O)}function w(O){return O===62?(e.consume(O),r.interrupt?n:I):s(O)}function S(O){return We(O)?(e.consume(O),S):F(O)}function T(O){return O===47?(e.consume(O),F):O===58||O===95||cn(O)?(e.consume(O),E):We(O)?(e.consume(O),T):F(O)}function E(O){return O===45||O===46||O===58||O===95||Qt(O)?(e.consume(O),E):z(O)}function z(O){return O===61?(e.consume(O),$):We(O)?(e.consume(O),z):T(O)}function $(O){return O===null||O===60||O===61||O===62||O===96?s(O):O===34||O===39?(e.consume(O),u=O,P):We(O)?(e.consume(O),$):L(O)}function P(O){return O===u?(e.consume(O),u=null,W):O===null||qe(O)?s(O):(e.consume(O),P)}function L(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||rt(O)?z(O):(e.consume(O),L)}function W(O){return O===47||O===62||We(O)?T(O):s(O)}function F(O){return O===62?(e.consume(O),U):s(O)}function U(O){return O===null||qe(O)?I(O):We(O)?(e.consume(O),U):s(O)}function I(O){return O===45&&i===2?(e.consume(O),ae):O===60&&i===1?(e.consume(O),H):O===62&&i===4?(e.consume(O),B):O===63&&i===3?(e.consume(O),q):O===93&&i===5?(e.consume(O),ue):qe(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(qA,ee,D)(O)):O===null||qe(O)?(e.exit("htmlFlowData"),D(O)):(e.consume(O),I)}function D(O){return e.check(IA,M,ee)(O)}function M(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Y}function Y(O){return O===null||qe(O)?D(O):(e.enter("htmlFlowData"),I(O))}function ae(O){return O===45?(e.consume(O),q):I(O)}function H(O){return O===47?(e.consume(O),l="",Z):I(O)}function Z(O){if(O===62){const ke=l.toLowerCase();return v2.includes(ke)?(e.consume(O),B):I(O)}return cn(O)&&l.length<8?(e.consume(O),l+=String.fromCharCode(O),Z):I(O)}function ue(O){return O===93?(e.consume(O),q):I(O)}function q(O){return O===62?(e.consume(O),B):O===45&&i===2?(e.consume(O),q):I(O)}function B(O){return O===null||qe(O)?(e.exit("htmlFlowData"),ee(O)):(e.consume(O),B)}function ee(O){return e.exit("htmlFlow"),n(O)}}function zA(e,n,s){const r=this;return i;function i(l){return qe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):s(l)}function a(l){return r.parser.lazy[r.now().line]?s(l):n(l)}}function MA(e,n,s){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Il,n,s)}}const OA={name:"htmlText",tokenize:_A};function _A(e,n,s){const r=this;let i,a,l;return c;function c(q){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(q),u}function u(q){return q===33?(e.consume(q),h):q===47?(e.consume(q),z):q===63?(e.consume(q),T):cn(q)?(e.consume(q),L):s(q)}function h(q){return q===45?(e.consume(q),m):q===91?(e.consume(q),a=0,j):cn(q)?(e.consume(q),S):s(q)}function m(q){return q===45?(e.consume(q),g):s(q)}function p(q){return q===null?s(q):q===45?(e.consume(q),x):qe(q)?(l=p,H(q)):(e.consume(q),p)}function x(q){return q===45?(e.consume(q),g):p(q)}function g(q){return q===62?ae(q):q===45?x(q):p(q)}function j(q){const B="CDATA[";return q===B.charCodeAt(a++)?(e.consume(q),a===B.length?k:j):s(q)}function k(q){return q===null?s(q):q===93?(e.consume(q),b):qe(q)?(l=k,H(q)):(e.consume(q),k)}function b(q){return q===93?(e.consume(q),w):k(q)}function w(q){return q===62?ae(q):q===93?(e.consume(q),w):k(q)}function S(q){return q===null||q===62?ae(q):qe(q)?(l=S,H(q)):(e.consume(q),S)}function T(q){return q===null?s(q):q===63?(e.consume(q),E):qe(q)?(l=T,H(q)):(e.consume(q),T)}function E(q){return q===62?ae(q):T(q)}function z(q){return cn(q)?(e.consume(q),$):s(q)}function $(q){return q===45||Qt(q)?(e.consume(q),$):P(q)}function P(q){return qe(q)?(l=P,H(q)):We(q)?(e.consume(q),P):ae(q)}function L(q){return q===45||Qt(q)?(e.consume(q),L):q===47||q===62||rt(q)?W(q):s(q)}function W(q){return q===47?(e.consume(q),ae):q===58||q===95||cn(q)?(e.consume(q),F):qe(q)?(l=W,H(q)):We(q)?(e.consume(q),W):ae(q)}function F(q){return q===45||q===46||q===58||q===95||Qt(q)?(e.consume(q),F):U(q)}function U(q){return q===61?(e.consume(q),I):qe(q)?(l=U,H(q)):We(q)?(e.consume(q),U):W(q)}function I(q){return q===null||q===60||q===61||q===62||q===96?s(q):q===34||q===39?(e.consume(q),i=q,D):qe(q)?(l=I,H(q)):We(q)?(e.consume(q),I):(e.consume(q),M)}function D(q){return q===i?(e.consume(q),i=void 0,Y):q===null?s(q):qe(q)?(l=D,H(q)):(e.consume(q),D)}function M(q){return q===null||q===34||q===39||q===60||q===61||q===96?s(q):q===47||q===62||rt(q)?W(q):(e.consume(q),M)}function Y(q){return q===47||q===62||rt(q)?W(q):s(q)}function ae(q){return q===62?(e.consume(q),e.exit("htmlTextData"),e.exit("htmlText"),n):s(q)}function H(q){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(q),e.exit("lineEnding"),Z}function Z(q){return We(q)?Ve(e,ue,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):ue(q)}function ue(q){return e.enter("htmlTextData"),l(q)}}const V1={name:"labelEnd",resolveAll:UA,resolveTo:HA,tokenize:KA},DA={tokenize:VA},BA={tokenize:YA},WA={tokenize:GA};function UA(e){let n=-1;const s=[];for(;++n<e.length;){const r=e[n][1];if(s.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==s.length&&Ln(e,0,e.length,s),e}function HA(e,n){let s=e.length,r=0,i,a,l,c;for(;s--;)if(i=e[s][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[s][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[s][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=s,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=s);const u={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[a][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",u,n],["enter",h,n]],c=Qn(c,e.slice(a+1,a+r+3)),c=Qn(c,[["enter",m,n]]),c=Qn(c,Eu(n.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),n)),c=Qn(c,[["exit",m,n],e[l-2],e[l-1],["exit",h,n]]),c=Qn(c,e.slice(l+1)),c=Qn(c,[["exit",u,n]]),Ln(e,a,e.length,c),e}function KA(e,n,s){const r=this;let i=r.events.length,a,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return c;function c(x){return a?a._inactive?p(x):(l=r.parser.defined.includes(fs(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),u):s(x)}function u(x){return x===40?e.attempt(DA,m,l?m:p)(x):x===91?e.attempt(BA,m,l?h:p)(x):l?m(x):p(x)}function h(x){return e.attempt(WA,m,p)(x)}function m(x){return n(x)}function p(x){return a._balanced=!0,s(x)}}function VA(e,n,s){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return rt(p)?_o(e,a)(p):a(p)}function a(p){return p===41?m(p):Zw(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return rt(p)?_o(e,u)(p):m(p)}function c(p){return s(p)}function u(p){return p===34||p===39||p===40?Jw(e,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function h(p){return rt(p)?_o(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),n):s(p)}}function YA(e,n,s){const r=this;return i;function i(c){return Xw.call(r,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(fs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(c):s(c)}function l(c){return s(c)}}function GA(e,n,s){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),n):s(a)}}const QA={name:"labelStartImage",resolveAll:V1.resolveAll,tokenize:ZA};function ZA(e,n,s){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):s(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?s(c):n(c)}}const XA={name:"labelStartLink",resolveAll:V1.resolveAll,tokenize:JA};function JA(e,n,s){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?s(l):n(l)}}const am={name:"lineEnding",tokenize:eP};function eP(e,n){return s;function s(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ve(e,n,"linePrefix")}}const yd={name:"thematicBreak",tokenize:tP};function tP(e,n,s){let r=0,i;return a;function a(h){return e.enter("thematicBreak"),l(h)}function l(h){return i=h,c(h)}function c(h){return h===i?(e.enter("thematicBreakSequence"),u(h)):r>=3&&(h===null||qe(h))?(e.exit("thematicBreak"),n(h)):s(h)}function u(h){return h===i?(e.consume(h),r++,u):(e.exit("thematicBreakSequence"),We(h)?Ve(e,c,"whitespace")(h):c(h))}}const xn={continuation:{tokenize:iP},exit:oP,name:"list",tokenize:rP},nP={partial:!0,tokenize:lP},sP={partial:!0,tokenize:aP};function rP(e,n,s){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return c;function c(g){const j=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(j==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:jf(g)){if(r.containerState.type||(r.containerState.type=j,e.enter(j,{_container:!0})),j==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(yd,s,h)(g):h(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(g)}return s(g)}function u(g){return jf(g)&&++l<10?(e.consume(g),u):(!r.interrupt||l<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),h(g)):s(g)}function h(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(Il,r.interrupt?s:m,e.attempt(nP,x,p))}function m(g){return r.containerState.initialBlankLine=!0,a++,x(g)}function p(g){return We(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),x):s(g)}function x(g){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(g)}}function iP(e,n,s){const r=this;return r.containerState._closeFlow=void 0,e.check(Il,i,a);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ve(e,n,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!We(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(sP,n,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ve(e,e.attempt(xn,n,s),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function aP(e,n,s){const r=this;return Ve(e,i,"listItemIndent",r.containerState.size+1);function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(a):s(a)}}function oP(e){e.exit(this.containerState.type)}function lP(e,n,s){const r=this;return Ve(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const l=r.events[r.events.length-1];return!We(a)&&l&&l[1].type==="listItemPrefixWhitespace"?n(a):s(a)}}const b2={name:"setextUnderline",resolveTo:cP,tokenize:dP};function cP(e,n){let s=e.length,r,i,a;for(;s--;)if(e[s][0]==="enter"){if(e[s][1].type==="content"){r=s;break}e[s][1].type==="paragraph"&&(i=s)}else e[s][1].type==="content"&&e.splice(s,1),!a&&e[s][1].type==="definition"&&(a=s);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",l,n]),e.splice(a+1,0,["exit",e[r][1],n]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function dP(e,n,s){const r=this;let i;return a;function a(h){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=h,l(h)):s(h)}function l(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===i?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),We(h)?Ve(e,u,"lineSuffix")(h):u(h))}function u(h){return h===null||qe(h)?(e.exit("setextHeadingLine"),n(h)):s(h)}}const uP={tokenize:hP};function hP(e){const n=this,s=e.attempt(Il,r,e.attempt(this.parser.constructs.flowInitial,i,Ve(e,e.attempt(this.parser.constructs.flow,i,e.attempt(xA,i)),"linePrefix")));return s;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),n.currentConstruct=void 0,s}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n.currentConstruct=void 0,s}}const pP={resolveAll:t3()},mP=e3("string"),fP=e3("text");function e3(e){return{resolveAll:t3(e==="text"?gP:void 0),tokenize:n};function n(s){const r=this,i=this.parser.constructs[e],a=s.attempt(i,l,c);return l;function l(m){return h(m)?a(m):c(m)}function c(m){if(m===null){s.consume(m);return}return s.enter("data"),s.consume(m),u}function u(m){return h(m)?(s.exit("data"),a(m)):(s.consume(m),u)}function h(m){if(m===null)return!0;const p=i[m];let x=-1;if(p)for(;++x<p.length;){const g=p[x];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function t3(e){return n;function n(s,r){let i=-1,a;for(;++i<=s.length;)a===void 0?s[i]&&s[i][1].type==="data"&&(a=i,i++):(!s[i]||s[i][1].type!=="data")&&(i!==a+2&&(s[a][1].end=s[i-1][1].end,s.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(s,r):s}}function gP(e,n){let s=0;for(;++s<=e.length;)if((s===e.length||e[s][1].type==="lineEnding")&&e[s-1][1].type==="data"){const r=e[s-1][1],i=n.sliceStream(r);let a=i.length,l=-1,c=0,u;for(;a--;){const h=i[a];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(h===-2)u=!0,c++;else if(h!==-1){a++;break}}if(n._contentTypeTextTrailing&&s===e.length&&(c=0),c){const h={type:s===e.length||u||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(s,0,["enter",h,n],["exit",h,n]),s+=2)}s++}return e}const xP={42:xn,43:xn,45:xn,48:xn,49:xn,50:xn,51:xn,52:xn,53:xn,54:xn,55:xn,56:xn,57:xn,62:Vw},yP={91:bA},jP={[-2]:im,[-1]:im,32:im},kP={35:TA,42:yd,45:[b2,yd],60:RA,61:b2,95:yd,96:k2,126:k2},vP={38:Gw,92:Yw},bP={[-5]:am,[-4]:am,[-3]:am,33:QA,38:Gw,42:kf,60:[XE,OA],91:XA,92:[CA,Yw],93:V1,95:kf,96:uA},wP={null:[kf,pP]},NP={null:[42,95]},SP={null:[]},CP=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:NP,contentInitial:yP,disable:SP,document:xP,flow:kP,flowInitial:jP,insideSpan:wP,string:vP,text:bP},Symbol.toStringTag,{value:"Module"}));function $P(e,n,s){let r={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const i={},a=[];let l=[],c=[];const u={attempt:P(z),check:P($),consume:S,enter:T,exit:E,interrupt:P($,{interrupt:!0})},h={code:null,containerState:{},defineSkip:k,events:[],now:j,parser:e,previous:null,sliceSerialize:x,sliceStream:g,write:p};let m=n.tokenize.call(h,u);return n.resolveAll&&a.push(n),h;function p(U){return l=Qn(l,U),b(),l[l.length-1]!==null?[]:(L(n,0),h.events=Eu(a,h.events,h),h.events)}function x(U,I){return EP(g(U),I)}function g(U){return TP(l,U)}function j(){const{_bufferIndex:U,_index:I,line:D,column:M,offset:Y}=r;return{_bufferIndex:U,_index:I,line:D,column:M,offset:Y}}function k(U){i[U.line]=U.column,F()}function b(){let U;for(;r._index<l.length;){const I=l[r._index];if(typeof I=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<I.length;)w(I.charCodeAt(r._bufferIndex));else w(I)}}function w(U){m=m(U)}function S(U){qe(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,F()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=U}function T(U,I){const D=I||{};return D.type=U,D.start=j(),h.events.push(["enter",D,h]),c.push(D),D}function E(U){const I=c.pop();return I.end=j(),h.events.push(["exit",I,h]),I}function z(U,I){L(U,I.from)}function $(U,I){I.restore()}function P(U,I){return D;function D(M,Y,ae){let H,Z,ue,q;return Array.isArray(M)?ee(M):"tokenize"in M?ee([M]):B(M);function B(xe){return Te;function Te(Ee){const Fe=Ee!==null&&xe[Ee],Ge=Ee!==null&&xe.null,pt=[...Array.isArray(Fe)?Fe:Fe?[Fe]:[],...Array.isArray(Ge)?Ge:Ge?[Ge]:[]];return ee(pt)(Ee)}}function ee(xe){return H=xe,Z=0,xe.length===0?ae:O(xe[Z])}function O(xe){return Te;function Te(Ee){return q=W(),ue=xe,xe.partial||(h.currentConstruct=xe),xe.name&&h.parser.constructs.disable.null.includes(xe.name)?pe():xe.tokenize.call(I?Object.assign(Object.create(h),I):h,u,ke,pe)(Ee)}}function ke(xe){return U(ue,q),Y}function pe(xe){return q.restore(),++Z<H.length?O(H[Z]):ae}}}function L(U,I){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&Ln(h.events,I,h.events.length-I,U.resolve(h.events.slice(I),h)),U.resolveTo&&(h.events=U.resolveTo(h.events,h))}function W(){const U=j(),I=h.previous,D=h.currentConstruct,M=h.events.length,Y=Array.from(c);return{from:M,restore:ae};function ae(){r=U,h.previous=I,h.currentConstruct=D,h.events.length=M,c=Y,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function TP(e,n){const s=n.start._index,r=n.start._bufferIndex,i=n.end._index,a=n.end._bufferIndex;let l;if(s===i)l=[e[s].slice(r,a)];else{if(l=e.slice(s,i),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}a>0&&l.push(e[i].slice(0,a))}return l}function EP(e,n){let s=-1;const r=[];let i;for(;++s<e.length;){const a=e[s];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
652
+ `;break}case-3:{l=`\r
653
+ `;break}case-2:{l=n?" ":" ";break}case-1:{if(!n&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,r.push(l)}return r.join("")}function AP(e){const r={constructs:Hw([CP,...(e||{}).extensions||[]]),content:i(HE),defined:[],document:i(VE),flow:i(uP),lazy:{},string:i(mP),text:i(fP)};return r;function i(a){return l;function l(c){return $P(r,a,c)}}}function PP(e){for(;!Qw(e););return e}const w2=/[\0\t\n\r]/g;function RP(){let e=1,n="",s=!0,r;return i;function i(a,l,c){const u=[];let h,m,p,x,g;for(a=n+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),p=0,n="",s&&(a.charCodeAt(0)===65279&&p++,s=void 0);p<a.length;){if(w2.lastIndex=p,h=w2.exec(a),x=h&&h.index!==void 0?h.index:a.length,g=a.charCodeAt(x),!h){n=a.slice(p);break}if(g===10&&p===x&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),p<x&&(u.push(a.slice(p,x)),e+=x-p),g){case 0:{u.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,u.push(-2);e++<m;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}p=x+1}return c&&(r&&u.push(-5),n&&u.push(n),u.push(null)),u}}const qP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function IP(e){return e.replace(qP,FP)}function FP(e,n,s){if(n)return n;if(s.charCodeAt(0)===35){const i=s.charCodeAt(1),a=i===120||i===88;return Kw(s.slice(a?2:1),a?16:10)}return K1(s)||e}const n3={}.hasOwnProperty;function LP(e,n,s){return n&&typeof n=="object"&&(s=n,n=void 0),zP(s)(PP(AP(s).document().write(RP()(e,n,!0))))}function zP(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Nn),autolinkProtocol:W,autolinkEmail:W,atxHeading:a(js),blockQuote:a(Ge),characterEscape:W,characterReference:W,codeFenced:a(pt),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(pt,l),codeText:a(sn,l),codeTextData:W,data:W,codeFlowValue:W,definition:a(On),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(dn),hardBreakEscape:a(qt),hardBreakTrailing:a(qt),htmlFlow:a(_n,l),htmlFlowData:W,htmlText:a(_n,l),htmlTextData:W,image:a(wn),label:l,link:a(Nn),listItem:a(Dt),listItemValue:x,listOrdered:a(Je,p),listUnordered:a(Je),paragraph:a(Sn),reference:O,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(js),strong:a(ks),thematicBreak:a(He)},exit:{atxHeading:u(),atxHeadingSequence:z,autolink:u(),autolinkEmail:Fe,autolinkProtocol:Ee,blockQuote:u(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:xe,characterReference:Te,codeFenced:u(b),codeFencedFence:k,codeFencedFenceInfo:g,codeFencedFenceMeta:j,codeFlowValue:F,codeIndented:u(w),codeText:u(Y),codeTextData:F,data:F,definition:u(),definitionDestinationString:E,definitionLabelString:S,definitionTitleString:T,emphasis:u(),hardBreakEscape:u(I),hardBreakTrailing:u(I),htmlFlow:u(D),htmlFlowData:F,htmlText:u(M),htmlTextData:F,image:u(H),label:ue,labelText:Z,lineEnding:U,link:u(ae),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ke,resourceDestinationString:q,resourceTitleString:B,resource:ee,setextHeading:u(L),setextHeadingLineSequence:P,setextHeadingText:$,strong:u(),thematicBreak:u()}};s3(n,(e||{}).mdastExtensions||[]);const s={};return r;function r(te){let he={type:"root",children:[]};const Ae={stack:[he],tokenStack:[],config:n,enter:c,exit:h,buffer:l,resume:m,data:s},Oe=[];let Ke=-1;for(;++Ke<te.length;)if(te[Ke][1].type==="listOrdered"||te[Ke][1].type==="listUnordered")if(te[Ke][0]==="enter")Oe.push(Ke);else{const Ct=Oe.pop();Ke=i(te,Ct,Ke)}for(Ke=-1;++Ke<te.length;){const Ct=n[te[Ke][0]];n3.call(Ct,te[Ke][1].type)&&Ct[te[Ke][1].type].call(Object.assign({sliceSerialize:te[Ke][2].sliceSerialize},Ae),te[Ke][1])}if(Ae.tokenStack.length>0){const Ct=Ae.tokenStack[Ae.tokenStack.length-1];(Ct[1]||N2).call(Ae,void 0,Ct[0])}for(he.position={start:Sr(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:Sr(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Ke=-1;++Ke<n.transforms.length;)he=n.transforms[Ke](he)||he;return he}function i(te,he,Ae){let Oe=he-1,Ke=-1,Ct=!1,ns,rn,ss,Os;for(;++Oe<=Ae;){const Et=te[Oe];switch(Et[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Et[0]==="enter"?Ke++:Ke--,Os=void 0;break}case"lineEndingBlank":{Et[0]==="enter"&&(ns&&!Os&&!Ke&&!ss&&(ss=Oe),Os=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Os=void 0}if(!Ke&&Et[0]==="enter"&&Et[1].type==="listItemPrefix"||Ke===-1&&Et[0]==="exit"&&(Et[1].type==="listUnordered"||Et[1].type==="listOrdered")){if(ns){let Dn=Oe;for(rn=void 0;Dn--;){const Bt=te[Dn];if(Bt[1].type==="lineEnding"||Bt[1].type==="lineEndingBlank"){if(Bt[0]==="exit")continue;rn&&(te[rn][1].type="lineEndingBlank",Ct=!0),Bt[1].type="lineEnding",rn=Dn}else if(!(Bt[1].type==="linePrefix"||Bt[1].type==="blockQuotePrefix"||Bt[1].type==="blockQuotePrefixWhitespace"||Bt[1].type==="blockQuoteMarker"||Bt[1].type==="listItemIndent"))break}ss&&(!rn||ss<rn)&&(ns._spread=!0),ns.end=Object.assign({},rn?te[rn][1].start:Et[1].end),te.splice(rn||Oe,0,["exit",ns,Et[2]]),Oe++,Ae++}if(Et[1].type==="listItemPrefix"){const Dn={type:"listItem",_spread:!1,start:Object.assign({},Et[1].start),end:void 0};ns=Dn,te.splice(Oe,0,["enter",Dn,Et[2]]),Oe++,Ae++,ss=void 0,Os=!0}}}return te[he][1]._spread=Ct,Ae}function a(te,he){return Ae;function Ae(Oe){c.call(this,te(Oe),Oe),he&&he.call(this,Oe)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(te,he,Ae){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([he,Ae||void 0]),te.position={start:Sr(he.start),end:void 0}}function u(te){return he;function he(Ae){te&&te.call(this,Ae),h.call(this,Ae)}}function h(te,he){const Ae=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==te.type&&(he?he.call(this,te,Oe[0]):(Oe[1]||N2).call(this,te,Oe[0]));else throw new Error("Cannot close `"+te.type+"` ("+Oo({start:te.start,end:te.end})+"): it’s not open");Ae.position.end=Sr(te.end)}function m(){return H1(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function x(te){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function g(){const te=this.resume(),he=this.stack[this.stack.length-1];he.lang=te}function j(){const te=this.resume(),he=this.stack[this.stack.length-1];he.meta=te}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te.replace(/(\r?\n|\r)$/g,"")}function S(te){const he=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=he,Ae.identifier=fs(this.sliceSerialize(te)).toLowerCase()}function T(){const te=this.resume(),he=this.stack[this.stack.length-1];he.title=te}function E(){const te=this.resume(),he=this.stack[this.stack.length-1];he.url=te}function z(te){const he=this.stack[this.stack.length-1];if(!he.depth){const Ae=this.sliceSerialize(te).length;he.depth=Ae}}function $(){this.data.setextHeadingSlurpLineEnding=!0}function P(te){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function W(te){const Ae=this.stack[this.stack.length-1].children;let Oe=Ae[Ae.length-1];(!Oe||Oe.type!=="text")&&(Oe=vs(),Oe.position={start:Sr(te.start),end:void 0},Ae.push(Oe)),this.stack.push(Oe)}function F(te){const he=this.stack.pop();he.value+=this.sliceSerialize(te),he.position.end=Sr(te.end)}function U(te){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=he.children[he.children.length-1];Ae.position.end=Sr(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(he.type)&&(W.call(this,te),F.call(this,te))}function I(){this.data.atHardBreak=!0}function D(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te}function M(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te}function Y(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te}function ae(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=he,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function H(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=he,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function Z(te){const he=this.sliceSerialize(te),Ae=this.stack[this.stack.length-2];Ae.label=IP(he),Ae.identifier=fs(he).toLowerCase()}function ue(){const te=this.stack[this.stack.length-1],he=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Oe=te.children;Ae.children=Oe}else Ae.alt=he}function q(){const te=this.resume(),he=this.stack[this.stack.length-1];he.url=te}function B(){const te=this.resume(),he=this.stack[this.stack.length-1];he.title=te}function ee(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function ke(te){const he=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=he,Ae.identifier=fs(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function pe(te){this.data.characterReferenceType=te.type}function xe(te){const he=this.sliceSerialize(te),Ae=this.data.characterReferenceType;let Oe;Ae?(Oe=Kw(he,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=K1(he);const Ke=this.stack[this.stack.length-1];Ke.value+=Oe}function Te(te){const he=this.stack.pop();he.position.end=Sr(te.end)}function Ee(te){F.call(this,te);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(te)}function Fe(te){F.call(this,te);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(te)}function Ge(){return{type:"blockquote",children:[]}}function pt(){return{type:"code",lang:null,meta:null,value:""}}function sn(){return{type:"inlineCode",value:""}}function On(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function dn(){return{type:"emphasis",children:[]}}function js(){return{type:"heading",depth:0,children:[]}}function qt(){return{type:"break"}}function _n(){return{type:"html",value:""}}function wn(){return{type:"image",title:null,url:"",alt:null}}function Nn(){return{type:"link",title:null,url:"",children:[]}}function Je(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function Dt(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function Sn(){return{type:"paragraph",children:[]}}function ks(){return{type:"strong",children:[]}}function vs(){return{type:"text",value:""}}function He(){return{type:"thematicBreak"}}}function Sr(e){return{line:e.line,column:e.column,offset:e.offset}}function s3(e,n){let s=-1;for(;++s<n.length;){const r=n[s];Array.isArray(r)?s3(e,r):MP(e,r)}}function MP(e,n){let s;for(s in n)if(n3.call(n,s))switch(s){case"canContainEols":{const r=n[s];r&&e[s].push(...r);break}case"transforms":{const r=n[s];r&&e[s].push(...r);break}case"enter":case"exit":{const r=n[s];r&&Object.assign(e[s],r);break}}}function N2(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Oo({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Oo({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Oo({start:n.start,end:n.end})+") is still open")}function OP(e){const n=this;n.parser=s;function s(r){return LP(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function _P(e,n){const s={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,s),e.applyData(n,s)}function DP(e,n){const s={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,s),[e.applyData(n,s),{type:"text",value:`
654
+ `}]}function BP(e,n){const s=n.value?n.value+`
655
+ `:"",r={},i=n.lang?n.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:s}]};return n.meta&&(a.data={meta:n.meta}),e.patch(n,a),a=e.applyData(n,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(n,a),a}function WP(e,n){const s={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function UP(e,n){const s={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function HP(e,n){const s=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=za(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,c+=1,e.footnoteCounts.set(r,c);const u={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+i,id:s+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(n,u);const h={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(n,h),e.applyData(n,h)}function KP(e,n){const s={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function VP(e,n){if(e.options.allowDangerousHtml){const s={type:"raw",value:n.value};return e.patch(n,s),e.applyData(n,s)}}function r3(e,n){const s=n.referenceType;let r="]";if(s==="collapsed"?r+="[]":s==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function YP(e,n){const s=String(n.identifier).toUpperCase(),r=e.definitionById.get(s);if(!r)return r3(e,n);const i={src:za(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,a),e.applyData(n,a)}function GP(e,n){const s={src:za(n.url)};n.alt!==null&&n.alt!==void 0&&(s.alt=n.alt),n.title!==null&&n.title!==void 0&&(s.title=n.title);const r={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,r),e.applyData(n,r)}function QP(e,n){const s={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,s);const r={type:"element",tagName:"code",properties:{},children:[s]};return e.patch(n,r),e.applyData(n,r)}function ZP(e,n){const s=String(n.identifier).toUpperCase(),r=e.definitionById.get(s);if(!r)return r3(e,n);const i={href:za(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function XP(e,n){const s={href:za(n.url)};n.title!==null&&n.title!==void 0&&(s.title=n.title);const r={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function JP(e,n,s){const r=e.all(n),i=s?eR(s):i3(n),a={},l=[];if(typeof n.checked=="boolean"){const m=r[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const m=r[c];(i||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
656
+ `}),m.type==="element"&&m.tagName==="p"&&!i?l.push(...m.children):l.push(m)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&l.push({type:"text",value:`
657
+ `});const h={type:"element",tagName:"li",properties:a,children:l};return e.patch(n,h),e.applyData(n,h)}function eR(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const s=e.children;let r=-1;for(;!n&&++r<s.length;)n=i3(s[r])}return n}function i3(e){const n=e.spread;return n??e.children.length>1}function tR(e,n){const s={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(s.start=n.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const a={type:"element",tagName:n.ordered?"ol":"ul",properties:s,children:e.wrap(r,!0)};return e.patch(n,a),e.applyData(n,a)}function nR(e,n){const s={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function sR(e,n){const s={type:"root",children:e.wrap(e.all(n))};return e.patch(n,s),e.applyData(n,s)}function rR(e,n){const s={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function iR(e,n){const s=e.all(n),r=s.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],l),i.push(l)}if(s.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(s,!0)},c=D1(n.children[1]),u=Mw(n.children[n.children.length-1]);c&&u&&(l.position={start:c,end:u}),i.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,a),e.applyData(n,a)}function aR(e,n,s){const r=s?s.children:void 0,a=(r?r.indexOf(n):1)===0?"th":"td",l=s&&s.type==="table"?s.align:void 0,c=l?l.length:n.children.length;let u=-1;const h=[];for(;++u<c;){const p=n.children[u],x={},g=l?l[u]:void 0;g&&(x.align=g);let j={type:"element",tagName:a,properties:x,children:[]};p&&(j.children=e.all(p),e.patch(p,j),j=e.applyData(p,j)),h.push(j)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(n,m),e.applyData(n,m)}function oR(e,n){const s={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}const S2=9,C2=32;function lR(e){const n=String(e),s=/\r?\n|\r/g;let r=s.exec(n),i=0;const a=[];for(;r;)a.push($2(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=s.exec(n);return a.push($2(n.slice(i),i>0,!1)),a.join("")}function $2(e,n,s){let r=0,i=e.length;if(n){let a=e.codePointAt(r);for(;a===S2||a===C2;)r++,a=e.codePointAt(r)}if(s){let a=e.codePointAt(i-1);for(;a===S2||a===C2;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function cR(e,n){const s={type:"text",value:lR(String(n.value))};return e.patch(n,s),e.applyData(n,s)}function dR(e,n){const s={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,s),e.applyData(n,s)}const uR={blockquote:_P,break:DP,code:BP,delete:WP,emphasis:UP,footnoteReference:HP,heading:KP,html:VP,imageReference:YP,image:GP,inlineCode:QP,linkReference:ZP,link:XP,listItem:JP,list:tR,paragraph:nR,root:sR,strong:rR,table:iR,tableCell:oR,tableRow:aR,text:cR,thematicBreak:dR,toml:ed,yaml:ed,definition:ed,footnoteDefinition:ed};function ed(){}const a3=-1,Au=0,Do=1,Kd=2,Y1=3,G1=4,Q1=5,Z1=6,o3=7,l3=8,T2=typeof self=="object"?self:globalThis,hR=(e,n)=>{const s=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,l]=n[i];switch(a){case Au:case a3:return s(l,i);case Do:{const c=s([],i);for(const u of l)c.push(r(u));return c}case Kd:{const c=s({},i);for(const[u,h]of l)c[r(u)]=r(h);return c}case Y1:return s(new Date(l),i);case G1:{const{source:c,flags:u}=l;return s(new RegExp(c,u),i)}case Q1:{const c=s(new Map,i);for(const[u,h]of l)c.set(r(u),r(h));return c}case Z1:{const c=s(new Set,i);for(const u of l)c.add(r(u));return c}case o3:{const{name:c,message:u}=l;return s(new T2[c](u),i)}case l3:return s(BigInt(l),i);case"BigInt":return s(Object(BigInt(l)),i);case"ArrayBuffer":return s(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return s(new DataView(c),l)}}return s(new T2[a](l),i)};return r},E2=e=>hR(new Map,e)(0),ra="",{toString:pR}={},{keys:mR}=Object,Ro=e=>{const n=typeof e;if(n!=="object"||!e)return[Au,n];const s=pR.call(e).slice(8,-1);switch(s){case"Array":return[Do,ra];case"Object":return[Kd,ra];case"Date":return[Y1,ra];case"RegExp":return[G1,ra];case"Map":return[Q1,ra];case"Set":return[Z1,ra];case"DataView":return[Do,s]}return s.includes("Array")?[Do,s]:s.includes("Error")?[o3,s]:[Kd,s]},td=([e,n])=>e===Au&&(n==="function"||n==="symbol"),fR=(e,n,s,r)=>{const i=(l,c)=>{const u=r.push(l)-1;return s.set(c,u),u},a=l=>{if(s.has(l))return s.get(l);let[c,u]=Ro(l);switch(c){case Au:{let m=l;switch(u){case"bigint":c=l3,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);m=null;break;case"undefined":return i([a3],l)}return i([c,m],l)}case Do:{if(u){let x=l;return u==="DataView"?x=new Uint8Array(l.buffer):u==="ArrayBuffer"&&(x=new Uint8Array(l)),i([u,[...x]],l)}const m=[],p=i([c,m],l);for(const x of l)m.push(a(x));return p}case Kd:{if(u)switch(u){case"BigInt":return i([u,l.toString()],l);case"Boolean":case"Number":case"String":return i([u,l.valueOf()],l)}if(n&&"toJSON"in l)return a(l.toJSON());const m=[],p=i([c,m],l);for(const x of mR(l))(e||!td(Ro(l[x])))&&m.push([a(x),a(l[x])]);return p}case Y1:return i([c,l.toISOString()],l);case G1:{const{source:m,flags:p}=l;return i([c,{source:m,flags:p}],l)}case Q1:{const m=[],p=i([c,m],l);for(const[x,g]of l)(e||!(td(Ro(x))||td(Ro(g))))&&m.push([a(x),a(g)]);return p}case Z1:{const m=[],p=i([c,m],l);for(const x of l)(e||!td(Ro(x)))&&m.push(a(x));return p}}const{message:h}=l;return i([c,{name:u,message:h}],l)};return a},A2=(e,{json:n,lossy:s}={})=>{const r=[];return fR(!(n||s),!!n,new Map,r)(e),r},Vd=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?E2(A2(e,n)):structuredClone(e):(e,n)=>E2(A2(e,n));function gR(e,n){const s=[{type:"text",value:"↩"}];return n>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),s}function xR(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function yR(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=e.options.footnoteBackContent||gR,r=e.options.footnoteBackLabel||xR,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let u=-1;for(;++u<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[u]);if(!h)continue;const m=e.all(h),p=String(h.identifier).toUpperCase(),x=za(p.toLowerCase());let g=0;const j=[],k=e.footnoteCounts.get(p);for(;k!==void 0&&++g<=k;){j.length>0&&j.push({type:"text",value:" "});let S=typeof s=="string"?s:s(u,g);typeof S=="string"&&(S={type:"text",value:S}),j.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+x+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,g),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const b=m[m.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const S=b.children[b.children.length-1];S&&S.type==="text"?S.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...j)}else m.push(...j);const w={type:"element",tagName:"li",properties:{id:n+"fn-"+x},children:e.wrap(m,!0)};e.patch(h,w),c.push(w)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Vd(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
658
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
659
+ `}]}}const Fl=(function(e){if(e==null)return bR;if(typeof e=="function")return Pu(e);if(typeof e=="object")return Array.isArray(e)?jR(e):kR(e);if(typeof e=="string")return vR(e);throw new Error("Expected function, string, or object as test")});function jR(e){const n=[];let s=-1;for(;++s<e.length;)n[s]=Fl(e[s]);return Pu(r);function r(...i){let a=-1;for(;++a<n.length;)if(n[a].apply(this,i))return!0;return!1}}function kR(e){const n=e;return Pu(s);function s(r){const i=r;let a;for(a in e)if(i[a]!==n[a])return!1;return!0}}function vR(e){return Pu(n);function n(s){return s&&s.type===e}}function Pu(e){return n;function n(s,r,i){return!!(wR(s)&&e.call(this,s,typeof r=="number"?r:void 0,i||void 0))}}function bR(){return!0}function wR(e){return e!==null&&typeof e=="object"&&"type"in e}const c3=[],NR=!0,vf=!1,SR="skip";function CR(e,n,s,r){let i;typeof n=="function"&&typeof s!="function"?(r=s,s=n):i=n;const a=Fl(i),l=r?-1:1;c(e,void 0,[])();function c(u,h,m){const p=u&&typeof u=="object"?u:{};if(typeof p.type=="string"){const g=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(u.type+(g?"<"+g+">":""))+")"})}return x;function x(){let g=c3,j,k,b;if((!n||a(u,h,m[m.length-1]||void 0))&&(g=$R(s(u,m)),g[0]===vf))return g;if("children"in u&&u.children){const w=u;if(w.children&&g[0]!==SR)for(k=(r?w.children.length:-1)+l,b=m.concat(w);k>-1&&k<w.children.length;){const S=w.children[k];if(j=c(S,k,b)(),j[0]===vf)return j;k=typeof j[1]=="number"?j[1]:k+l}}return g}}}function $R(e){return Array.isArray(e)?e:typeof e=="number"?[NR,e]:e==null?c3:[e]}function X1(e,n,s,r){let i,a,l;typeof n=="function"&&typeof s!="function"?(a=void 0,l=n,i=s):(a=n,l=s,i=r),CR(e,a,c,i);function c(u,h){const m=h[h.length-1],p=m?m.children.indexOf(u):void 0;return l(u,p,m)}}const bf={}.hasOwnProperty,TR={};function ER(e,n){const s=n||TR,r=new Map,i=new Map,a=new Map,l={...uR,...s.handlers},c={all:h,applyData:PR,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:u,options:s,patch:AR,wrap:qR};return X1(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?r:i,x=String(m.identifier).toUpperCase();p.has(x)||p.set(x,m)}}),c;function u(m,p){const x=m.type,g=c.handlers[x];if(bf.call(c.handlers,x)&&g)return g(c,m,p);if(c.options.passThrough&&c.options.passThrough.includes(x)){if("children"in m){const{children:k,...b}=m,w=Vd(b);return w.children=c.all(m),w}return Vd(m)}return(c.options.unknownHandler||RR)(c,m,p)}function h(m){const p=[];if("children"in m){const x=m.children;let g=-1;for(;++g<x.length;){const j=c.one(x[g],m);if(j){if(g&&x[g-1].type==="break"&&(!Array.isArray(j)&&j.type==="text"&&(j.value=P2(j.value)),!Array.isArray(j)&&j.type==="element")){const k=j.children[0];k&&k.type==="text"&&(k.value=P2(k.value))}Array.isArray(j)?p.push(...j):p.push(j)}}}return p}}function AR(e,n){e.position&&(n.position=xE(e))}function PR(e,n){let s=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(s.type==="element")s.tagName=r;else{const l="children"in s?s.children:[s];s={type:"element",tagName:r,properties:{},children:l}}s.type==="element"&&a&&Object.assign(s.properties,Vd(a)),"children"in s&&s.children&&i!==null&&i!==void 0&&(s.children=i)}return s}function RR(e,n){const s=n.data||{},r="value"in n&&!(bf.call(s,"hProperties")||bf.call(s,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function qR(e,n){const s=[];let r=-1;for(n&&s.push({type:"text",value:`
660
+ `});++r<e.length;)r&&s.push({type:"text",value:`
661
+ `}),s.push(e[r]);return n&&e.length>0&&s.push({type:"text",value:`
662
+ `}),s}function P2(e){let n=0,s=e.charCodeAt(n);for(;s===9||s===32;)n++,s=e.charCodeAt(n);return e.slice(n)}function R2(e,n){const s=ER(e,n),r=s.one(e,void 0),i=yR(s),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
663
+ `},i),a}function IR(e,n){return e&&"run"in e?async function(s,r){const i=R2(s,{file:r,...n});await e.run(i,r)}:function(s,r){return R2(s,{file:r,...e||n})}}function q2(e){if(e)throw e}var om,I2;function FR(){if(I2)return om;I2=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,s=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(h){return typeof Array.isArray=="function"?Array.isArray(h):n.call(h)==="[object Array]"},a=function(h){if(!h||n.call(h)!=="[object Object]")return!1;var m=e.call(h,"constructor"),p=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!p)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},l=function(h,m){s&&m.name==="__proto__"?s(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},c=function(h,m){if(m==="__proto__")if(e.call(h,m)){if(r)return r(h,m).value}else return;return h[m]};return om=function u(){var h,m,p,x,g,j,k=arguments[0],b=1,w=arguments.length,S=!1;for(typeof k=="boolean"&&(S=k,k=arguments[1]||{},b=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});b<w;++b)if(h=arguments[b],h!=null)for(m in h)p=c(k,m),x=c(h,m),k!==x&&(S&&x&&(a(x)||(g=i(x)))?(g?(g=!1,j=p&&i(p)?p:[]):j=p&&a(p)?p:{},l(k,{name:m,newValue:u(S,j,x)})):typeof x<"u"&&l(k,{name:m,newValue:x}));return k},om}var LR=FR();const lm=Uf(LR);function wf(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function zR(){const e=[],n={run:s,use:r};return n;function s(...i){let a=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...i);function c(u,...h){const m=e[++a];let p=-1;if(u){l(u);return}for(;++p<i.length;)(h[p]===null||h[p]===void 0)&&(h[p]=i[p]);i=h,m?MR(m,c)(...h):l(null,...h)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function MR(e,n){let s;return r;function r(...l){const c=e.length>l.length;let u;c&&l.push(i);try{u=e.apply(this,l)}catch(h){const m=h;if(c&&s)throw m;return i(m)}c||(u&&u.then&&typeof u.then=="function"?u.then(a,i):u instanceof Error?i(u):a(u))}function i(l,...c){s||(s=!0,n(l,...c))}function a(l){i(null,l)}}const Ts={basename:OR,dirname:_R,extname:DR,join:BR,sep:"/"};function OR(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Ll(e);let s=0,r=-1,i=e.length,a;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){s=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(s,r)}if(n===e)return"";let l=-1,c=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){s=i+1;break}}else l<0&&(a=!0,l=i+1),c>-1&&(e.codePointAt(i)===n.codePointAt(c--)?c<0&&(r=i):(c=-1,r=l));return s===r?r=l:r<0&&(r=e.length),e.slice(s,r)}function _R(e){if(Ll(e),e.length===0)return".";let n=-1,s=e.length,r;for(;--s;)if(e.codePointAt(s)===47){if(r){n=s;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function DR(e){Ll(e);let n=e.length,s=-1,r=0,i=-1,a=0,l;for(;n--;){const c=e.codePointAt(n);if(c===47){if(l){r=n+1;break}continue}s<0&&(l=!0,s=n+1),c===46?i<0?i=n:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||s<0||a===0||a===1&&i===s-1&&i===r+1?"":e.slice(i,s)}function BR(...e){let n=-1,s;for(;++n<e.length;)Ll(e[n]),e[n]&&(s=s===void 0?e[n]:s+"/"+e[n]);return s===void 0?".":WR(s)}function WR(e){Ll(e);const n=e.codePointAt(0)===47;let s=UR(e,!n);return s.length===0&&!n&&(s="."),s.length>0&&e.codePointAt(e.length-1)===47&&(s+="/"),n?"/"+s:s}function UR(e,n){let s="",r=0,i=-1,a=0,l=-1,c,u;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(i===l-1||a===1))if(i!==l-1&&a===2){if(s.length<2||r!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(u=s.lastIndexOf("/"),u!==s.length-1){u<0?(s="",r=0):(s=s.slice(0,u),r=s.length-1-s.lastIndexOf("/")),i=l,a=0;continue}}else if(s.length>0){s="",r=0,i=l,a=0;continue}}n&&(s=s.length>0?s+"/..":"..",r=2)}else s.length>0?s+="/"+e.slice(i+1,l):s=e.slice(i+1,l),r=l-i-1;i=l,a=0}else c===46&&a>-1?a++:a=-1}return s}function Ll(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const HR={cwd:KR};function KR(){return"/"}function Nf(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function VR(e){if(typeof e=="string")e=new URL(e);else if(!Nf(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return YR(e)}function YR(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let s=-1;for(;++s<n.length;)if(n.codePointAt(s)===37&&n.codePointAt(s+1)===50){const r=n.codePointAt(s+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(n)}const cm=["history","path","basename","stem","extname","dirname"];class d3{constructor(n){let s;n?Nf(n)?s={path:n}:typeof n=="string"||GR(n)?s={value:n}:s=n:s={},this.cwd="cwd"in s?"":HR.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<cm.length;){const a=cm[r];a in s&&s[a]!==void 0&&s[a]!==null&&(this[a]=a==="history"?[...s[a]]:s[a])}let i;for(i in s)cm.includes(i)||(this[i]=s[i])}get basename(){return typeof this.path=="string"?Ts.basename(this.path):void 0}set basename(n){um(n,"basename"),dm(n,"basename"),this.path=Ts.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Ts.dirname(this.path):void 0}set dirname(n){F2(this.basename,"dirname"),this.path=Ts.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Ts.extname(this.path):void 0}set extname(n){if(dm(n,"extname"),F2(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ts.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Nf(n)&&(n=VR(n)),um(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Ts.basename(this.path,this.extname):void 0}set stem(n){um(n,"stem"),dm(n,"stem"),this.path=Ts.join(this.dirname||"",n+(this.extname||""))}fail(n,s,r){const i=this.message(n,s,r);throw i.fatal=!0,i}info(n,s,r){const i=this.message(n,s,r);return i.fatal=void 0,i}message(n,s,r){const i=new nn(n,s,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function dm(e,n){if(e&&e.includes(Ts.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Ts.sep+"`")}function um(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function F2(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function GR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const QR=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),ZR={}.hasOwnProperty;class J1 extends QR{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=zR()}copy(){const n=new J1;let s=-1;for(;++s<this.attachers.length;){const r=this.attachers[s];n.use(...r)}return n.data(lm(!0,{},this.namespace)),n}data(n,s){return typeof n=="string"?arguments.length===2?(mm("data",this.frozen),this.namespace[n]=s,this):ZR.call(this.namespace,n)&&this.namespace[n]||void 0:n?(mm("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=s.call(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const s=nd(n),r=this.parser||this.Parser;return hm("parse",r),r(String(s),s)}process(n,s){const r=this;return this.freeze(),hm("process",this.parser||this.Parser),pm("process",this.compiler||this.Compiler),s?i(void 0,s):new Promise(i);function i(a,l){const c=nd(n),u=r.parse(c);r.run(u,c,function(m,p,x){if(m||!p||!x)return h(m);const g=p,j=r.stringify(g,x);eq(j)?x.value=j:x.result=j,h(m,x)});function h(m,p){m||!p?l(m):a?a(p):s(void 0,p)}}}processSync(n){let s=!1,r;return this.freeze(),hm("processSync",this.parser||this.Parser),pm("processSync",this.compiler||this.Compiler),this.process(n,i),z2("processSync","process",s),r;function i(a,l){s=!0,q2(a),r=l}}run(n,s,r){L2(n),this.freeze();const i=this.transformers;return!r&&typeof s=="function"&&(r=s,s=void 0),r?a(void 0,r):new Promise(a);function a(l,c){const u=nd(s);i.run(n,u,h);function h(m,p,x){const g=p||n;m?c(m):l?l(g):r(void 0,g,x)}}}runSync(n,s){let r=!1,i;return this.run(n,s,a),z2("runSync","run",r),i;function a(l,c){q2(l),i=c,r=!0}}stringify(n,s){this.freeze();const r=nd(s),i=this.compiler||this.Compiler;return pm("stringify",i),L2(n),i(n,r)}use(n,...s){const r=this.attachers,i=this.namespace;if(mm("use",this.frozen),n!=null)if(typeof n=="function")u(n,s);else if(typeof n=="object")Array.isArray(n)?c(n):l(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function a(h){if(typeof h=="function")u(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...p]=h;u(m,p)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(h.plugins),h.settings&&(i.settings=lm(!0,i.settings,h.settings))}function c(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const p=h[m];a(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function u(h,m){let p=-1,x=-1;for(;++p<r.length;)if(r[p][0]===h){x=p;break}if(x===-1)r.push([h,...m]);else if(m.length>0){let[g,...j]=m;const k=r[x][1];wf(k)&&wf(g)&&(g=lm(!0,k,g)),r[x]=[h,g,...j]}}}}const XR=new J1().freeze();function hm(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function pm(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mm(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function L2(e){if(!wf(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function z2(e,n,s){if(!s)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function nd(e){return JR(e)?e:new d3(e)}function JR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function eq(e){return typeof e=="string"||tq(e)}function tq(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nq="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",M2=[],O2={allowDangerousHtml:!0},sq=/^(https?|ircs?|mailto|xmpp)$/i,rq=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function eg(e){const n=iq(e),s=aq(e);return oq(n.runSync(n.parse(s),s),e)}function iq(e){const n=e.rehypePlugins||M2,s=e.remarkPlugins||M2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...O2}:O2;return XR().use(OP).use(s).use(IR,r).use(n)}function aq(e){const n=e.children||"",s=new d3;return typeof n=="string"&&(s.value=n),s}function oq(e,n){const s=n.allowedElements,r=n.allowElement,i=n.components,a=n.disallowedElements,l=n.skipHtml,c=n.unwrapDisallowed,u=n.urlTransform||lq;for(const m of rq)Object.hasOwn(n,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+nq+m.id,void 0);return n.className&&(e={type:"element",tagName:"div",properties:{className:n.className},children:e.type==="root"?e.children:[e]}),X1(e,h),bE(e,{Fragment:t.Fragment,components:i,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0});function h(m,p,x){if(m.type==="raw"&&x&&typeof p=="number")return l?x.children.splice(p,1):x.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let g;for(g in rm)if(Object.hasOwn(rm,g)&&Object.hasOwn(m.properties,g)){const j=m.properties[g],k=rm[g];(k===null||k.includes(m.tagName))&&(m.properties[g]=u(String(j||""),g,m))}}if(m.type==="element"){let g=s?!s.includes(m.tagName):a?a.includes(m.tagName):!1;if(!g&&r&&typeof p=="number"&&(g=!r(m,p,x)),g&&x&&typeof p=="number")return c&&m.children?x.children.splice(p,1,...m.children):x.children.splice(p,1),p}}}function lq(e){const n=e.indexOf(":"),s=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||s!==-1&&n>s||r!==-1&&n>r||sq.test(e.slice(0,n))?e:""}function _2(e,n){const s=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,i=s.indexOf(n);for(;i!==-1;)r++,i=s.indexOf(n,i+n.length);return r}function cq(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const u3=[],dq=!0,fm=!1,Sf="skip";function uq(e,n,s,r){if(!e||typeof e!="object")throw new Error("Unexpected value `"+e+"` for `tree`, expected node");let i,a,l,c;if(a=n,typeof a=="function")l=a;else if(a&&typeof a=="object"){if(!(a.enter===null||a.enter===void 0))if(typeof a.enter=="function")l=a.enter;else throw new Error("Unexpected value `"+a.enter+"` for `visitors.enter`, expected optional visitor");if(typeof a.exit=="function")c=a.exit;else throw new Error("Unexpected value `"+a.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw new Error("Unexpected value `"+a+"` for `enter` or `visitors`, expected visitor or object with visitors");Fl(i);const u=1;h(e,void 0,[])();function h(m,p,x){const g=m&&typeof m=="object"?m:{};if(typeof g.type=="string"){const k=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(j,"name",{value:"node ("+(m.type+(k?"<"+k+">":""))+")"})}return j;function j(){const k=!i;let b=u3;if(l&&k&&(b=D2(l(m,x,p)),b[0]===fm))return b;if("children"in m&&m.children){const w=m;if(w.children&&b[0]!==Sf){let S=-1+u;const T=[...x,w];for(;S>-1&&S<w.children.length;){const E=w.children[S],z=h(E,S,T)();if(z[0]===fm)return z;S=typeof z[1]=="number"?z[1]:S+u}}}if(c&&k){const w=D2(c(m,x,p));if(w[0]===Sf)throw new Error("Unexpected value `"+w[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(w[0]===fm||typeof w[1]=="number")return w}return b}}}function D2(e){return Array.isArray(e)?e:typeof e=="number"?[dq,e]:e==null?u3:[e]}function hq(e,n,s){const i=Fl((s||{}).ignore||[]),a=pq(n);let l=-1;for(;++l<a.length;)uq(e,c);function c(h,m,p){if(h.type==="text"&&typeof p=="number")return u(h,m,p);if(i(h,p,m[m.length-1]))return Sf}function u(h,m,p){const x=m[m.length-1],g=a[l][0],j=a[l][1];let k=0,b=!1,w=[];g.lastIndex=0;let S=g.exec(h.value);for(;S;){const E=S.index,z={index:S.index,input:S.input,stack:[...m,h]};let $=j(...S,z);if(typeof $=="string"&&($=$.length>0?{type:"text",value:$}:void 0),$===!1)g.lastIndex=E+1;else{if(k!==E&&T({type:"text",value:h.value.slice(k,E)}),Array.isArray($))for(const P of $)T(P);else $&&T($);k=E+S[0].length,b=!0}if(!g.global)break;S=g.exec(h.value)}return b?(k<h.value.length&&T({type:"text",value:h.value.slice(k)}),x.children.splice(p,1,...w)):w=[h],p+w.length;function T(E){const z=w[w.length-1];z&&z.type==="text"&&E.type==="text"?z.value+=E.value:w.push(E)}}}function pq(e){if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=[],s=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<s.length;){const i=s[r];n.push([mq(i[0]),fq(i[1])])}return n}function mq(e){return typeof e=="string"?new RegExp(cq(e),"g"):e}function fq(e){return typeof e=="function"?e:function(){return e}}const gm="phrasing",xm=["autolink","link","image","label"];function gq(){return{transforms:[wq],enter:{literalAutolink:yq,literalAutolinkEmail:ym,literalAutolinkHttp:ym,literalAutolinkWww:ym},exit:{literalAutolink:bq,literalAutolinkEmail:vq,literalAutolinkHttp:jq,literalAutolinkWww:kq}}}function xq(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:gm,notInConstruct:xm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:gm,notInConstruct:xm},{character:":",before:"[ps]",after:"\\/",inConstruct:gm,notInConstruct:xm}]}}function yq(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ym(e){this.config.enter.autolinkProtocol.call(this,e)}function jq(e){this.config.exit.autolinkProtocol.call(this,e)}function kq(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function vq(e){this.config.exit.autolinkEmail.call(this,e)}function bq(e){this.exit(e)}function wq(e){hq(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Nq],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Sq]],{ignore:["link","linkReference"]})}function Nq(e,n,s,r,i){let a="";if(!h3(i)||(/^w/i.test(n)&&(s=n+s,n="",a="http://"),!Cq(s)))return!1;const l=$q(s+r);if(!l[0])return!1;const c={type:"link",title:null,url:a+n+l[0],children:[{type:"text",value:n+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function Sq(e,n,s,r){return!h3(r,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+s,children:[{type:"text",value:n+"@"+s}]}}function Cq(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function $q(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let s=n[0],r=s.indexOf(")");const i=_2(e,"(");let a=_2(e,")");for(;r!==-1&&i>a;)e+=s.slice(0,r+1),s=s.slice(r+1),r=s.indexOf(")"),a++;return[e,s]}function h3(e,n){const s=e.input.charCodeAt(e.index-1);return(e.index===0||yi(s)||Tu(s))&&(!n||s!==47)}p3.peek=Lq;function Tq(){this.buffer()}function Eq(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Aq(){this.buffer()}function Pq(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Rq(e){const n=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=fs(this.sliceSerialize(e)).toLowerCase(),s.label=n}function qq(e){this.exit(e)}function Iq(e){const n=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=fs(this.sliceSerialize(e)).toLowerCase(),s.label=n}function Fq(e){this.exit(e)}function Lq(){return"["}function p3(e,n,s,r){const i=s.createTracker(r);let a=i.move("[^");const l=s.enter("footnoteReference"),c=s.enter("reference");return a+=i.move(s.safe(s.associationId(e),{after:"]",before:a})),c(),l(),a+=i.move("]"),a}function zq(){return{enter:{gfmFootnoteCallString:Tq,gfmFootnoteCall:Eq,gfmFootnoteDefinitionLabelString:Aq,gfmFootnoteDefinition:Pq},exit:{gfmFootnoteCallString:Rq,gfmFootnoteCall:qq,gfmFootnoteDefinitionLabelString:Iq,gfmFootnoteDefinition:Fq}}}function Mq(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:s,footnoteReference:p3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(r,i,a,l){const c=a.createTracker(l);let u=c.move("[^");const h=a.enter("footnoteDefinition"),m=a.enter("label");return u+=c.move(a.safe(a.associationId(r),{before:u,after:"]"})),m(),u+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),u+=c.move((n?`
664
+ `:" ")+a.indentLines(a.containerFlow(r,c.current()),n?m3:Oq))),h(),u}}function Oq(e,n,s){return n===0?e:m3(e,n,s)}function m3(e,n,s){return(s?"":" ")+e}const _q=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];tg.attention=Hq;tg.peek=Kq;function Dq(){return{canContainEols:["delete"],enter:{strikethrough:Wq},exit:{strikethrough:Uq}}}function Bq(){return{handlers:{delete:tg},unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:_q}]}}function Wq(e){this.enter({type:"delete",children:[],position:void 0},e)}function Uq(e){this.exit(e)}function tg(e,n,s,r){const i=s.createTracker(r),a=s.stack.includes("strikethrough")?"~":"~~",l=s.enter("strikethrough");let c=i.move(a);return c+=s.containerPhrasing(e,{...i.current(),before:c,after:"~"}),c+=i.move(a),l(),c}function Hq(){return{construct:"strikethrough",markers:["~"],sizes:[2,1]}}function Kq(){return"~"}function Vq(e){return e.length}function Yq(e,n){const s=n||{},r=(s.align||[]).concat(),i=s.stringLength||Vq,a=[],l=[],c=[],u=[];let h=0,m=-1;for(;++m<e.length;){const k=[],b=[];let w=-1;for(e[m].length>h&&(h=e[m].length);++w<e[m].length;){const S=Gq(e[m][w]);if(s.alignDelimiters!==!1){const T=i(S);b[w]=T,(u[w]===void 0||T>u[w])&&(u[w]=T)}k.push(S)}l[m]=k,c[m]=b}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<h;)a[p]=B2(r[p]);else{const k=B2(r);for(;++p<h;)a[p]=k}p=-1;const x=[],g=[];for(;++p<h;){const k=a[p];let b="",w="";k===99?(b=":",w=":"):k===108?b=":":k===114&&(w=":");let S=s.alignDelimiters===!1?1:Math.max(1,u[p]-b.length-w.length);const T=b+"-".repeat(S)+w;s.alignDelimiters!==!1&&(S=b.length+S+w.length,S>u[p]&&(u[p]=S),g[p]=S),x[p]=T}l.splice(1,0,x),c.splice(1,0,g),m=-1;const j=[];for(;++m<l.length;){const k=l[m],b=c[m];p=-1;const w=[];for(;++p<h;){const S=k[p]||"";let T="",E="";if(s.alignDelimiters!==!1){const z=u[p]-(b[p]||0),$=a[p];$===114?T=" ".repeat(z):$===99?z%2?(T=" ".repeat(z/2+.5),E=" ".repeat(z/2-.5)):(T=" ".repeat(z/2),E=T):E=" ".repeat(z)}s.delimiterStart!==!1&&!p&&w.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&S==="")&&(s.delimiterStart!==!1||p)&&w.push(" "),s.alignDelimiters!==!1&&w.push(T),w.push(S),s.alignDelimiters!==!1&&w.push(E),s.padding!==!1&&w.push(" "),(s.delimiterEnd!==!1||p!==h-1)&&w.push("|")}j.push(s.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return j.join(`
665
+ `)}function Gq(e){return e==null?"":String(e)}function B2(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function Qq(e,n,s,r){const i=s.enter("blockquote"),a=s.createTracker(r);a.move("> "),a.shift(2);const l=s.indentLines(s.containerFlow(e,a.current()),Zq);return i(),l}function Zq(e,n,s){return">"+(s?"":" ")+e}function Xq(e,n){return W2(e,n.inConstruct,!0)&&!W2(e,n.notInConstruct,!1)}function W2(e,n,s){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return s;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function U2(e,n,s,r){let i=-1;for(;++i<s.unsafe.length;)if(s.unsafe[i].character===`
666
+ `&&Xq(s.stack,s.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
667
+ `}function Jq(e,n){const s=String(e);let r=s.indexOf(n),i=r,a=0,l=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>l&&(l=a):a=1,i=r+n.length,r=s.indexOf(n,i);return l}function eI(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function tI(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function nI(e,n,s,r){const i=tI(s),a=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(eI(e,s)){const p=s.enter("codeIndented"),x=s.indentLines(a,sI);return p(),x}const c=s.createTracker(r),u=i.repeat(Math.max(Jq(a,i)+1,3)),h=s.enter("codeFenced");let m=c.move(u);if(e.lang){const p=s.enter(`codeFencedLang${l}`);m+=c.move(s.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),p()}if(e.lang&&e.meta){const p=s.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(s.safe(e.meta,{before:m,after:`
668
+ `,encode:["`"],...c.current()})),p()}return m+=c.move(`
669
+ `),a&&(m+=c.move(a+`
670
+ `)),m+=c.move(u),h(),m}function sI(e,n,s){return(s?"":" ")+e}function ng(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function rI(e,n,s,r){const i=ng(s),a=i==='"'?"Quote":"Apostrophe",l=s.enter("definition");let c=s.enter("label");const u=s.createTracker(r);let h=u.move("[");return h+=u.move(s.safe(s.associationId(e),{before:h,after:"]",...u.current()})),h+=u.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=s.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(s.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(c=s.enter("destinationRaw"),h+=u.move(s.safe(e.url,{before:h,after:e.title?" ":`
671
+ `,...u.current()}))),c(),e.title&&(c=s.enter(`title${a}`),h+=u.move(" "+i),h+=u.move(s.safe(e.title,{before:h,after:i,...u.current()})),h+=u.move(i),c()),l(),h}function iI(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function dl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Yd(e,n,s){const r=wa(e),i=wa(n);return r===void 0?i===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}f3.peek=aI;function f3(e,n,s,r){const i=iI(s),a=s.enter("emphasis"),l=s.createTracker(r),c=l.move(i);let u=l.move(s.containerPhrasing(e,{after:i,before:c,...l.current()}));const h=u.charCodeAt(0),m=Yd(r.before.charCodeAt(r.before.length-1),h,i);m.inside&&(u=dl(h)+u.slice(1));const p=u.charCodeAt(u.length-1),x=Yd(r.after.charCodeAt(0),p,i);x.inside&&(u=u.slice(0,-1)+dl(p));const g=l.move(i);return a(),s.attentionEncodeSurroundingInfo={after:x.outside,before:m.outside},c+u+g}function aI(e,n,s){return s.options.emphasis||"*"}function oI(e,n){let s=!1;return X1(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return s=!0,vf}),!!((!e.depth||e.depth<3)&&H1(e)&&(n.options.setext||s))}function lI(e,n,s,r){const i=Math.max(Math.min(6,e.depth||1),1),a=s.createTracker(r);if(oI(e,s)){const m=s.enter("headingSetext"),p=s.enter("phrasing"),x=s.containerPhrasing(e,{...a.current(),before:`
672
+ `,after:`
673
+ `});return p(),m(),x+`
674
+ `+(i===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
675
+ `))+1))}const l="#".repeat(i),c=s.enter("headingAtx"),u=s.enter("phrasing");a.move(l+" ");let h=s.containerPhrasing(e,{before:"# ",after:`
676
+ `,...a.current()});return/^[\t ]/.test(h)&&(h=dl(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,s.options.closeAtx&&(h+=" "+l),u(),c(),h}g3.peek=cI;function g3(e){return e.value||""}function cI(){return"<"}x3.peek=dI;function x3(e,n,s,r){const i=ng(s),a=i==='"'?"Quote":"Apostrophe",l=s.enter("image");let c=s.enter("label");const u=s.createTracker(r);let h=u.move("![");return h+=u.move(s.safe(e.alt,{before:h,after:"]",...u.current()})),h+=u.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=s.enter("destinationLiteral"),h+=u.move("<"),h+=u.move(s.safe(e.url,{before:h,after:">",...u.current()})),h+=u.move(">")):(c=s.enter("destinationRaw"),h+=u.move(s.safe(e.url,{before:h,after:e.title?" ":")",...u.current()}))),c(),e.title&&(c=s.enter(`title${a}`),h+=u.move(" "+i),h+=u.move(s.safe(e.title,{before:h,after:i,...u.current()})),h+=u.move(i),c()),h+=u.move(")"),l(),h}function dI(){return"!"}y3.peek=uI;function y3(e,n,s,r){const i=e.referenceType,a=s.enter("imageReference");let l=s.enter("label");const c=s.createTracker(r);let u=c.move("![");const h=s.safe(e.alt,{before:u,after:"]",...c.current()});u+=c.move(h+"]["),l();const m=s.stack;s.stack=[],l=s.enter("reference");const p=s.safe(s.associationId(e),{before:u,after:"]",...c.current()});return l(),s.stack=m,a(),i==="full"||!h||h!==p?u+=c.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=c.move("]"),u}function uI(){return"!"}j3.peek=hI;function j3(e,n,s){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<s.unsafe.length;){const l=s.unsafe[a],c=s.compilePattern(l);let u;if(l.atBreak)for(;u=c.exec(r);){let h=u.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(u.index+1)}}return i+r+i}function hI(){return"`"}function k3(e,n){const s=H1(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(s===e.url||"mailto:"+s===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}v3.peek=pI;function v3(e,n,s,r){const i=ng(s),a=i==='"'?"Quote":"Apostrophe",l=s.createTracker(r);let c,u;if(k3(e,s)){const m=s.stack;s.stack=[],c=s.enter("autolink");let p=l.move("<");return p+=l.move(s.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),c(),s.stack=m,p}c=s.enter("link"),u=s.enter("label");let h=l.move("[");return h+=l.move(s.containerPhrasing(e,{before:h,after:"](",...l.current()})),h+=l.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=s.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(s.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(u=s.enter("destinationRaw"),h+=l.move(s.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),u(),e.title&&(u=s.enter(`title${a}`),h+=l.move(" "+i),h+=l.move(s.safe(e.title,{before:h,after:i,...l.current()})),h+=l.move(i),u()),h+=l.move(")"),c(),h}function pI(e,n,s){return k3(e,s)?"<":"["}b3.peek=mI;function b3(e,n,s,r){const i=e.referenceType,a=s.enter("linkReference");let l=s.enter("label");const c=s.createTracker(r);let u=c.move("[");const h=s.containerPhrasing(e,{before:u,after:"]",...c.current()});u+=c.move(h+"]["),l();const m=s.stack;s.stack=[],l=s.enter("reference");const p=s.safe(s.associationId(e),{before:u,after:"]",...c.current()});return l(),s.stack=m,a(),i==="full"||!h||h!==p?u+=c.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=c.move("]"),u}function mI(){return"["}function sg(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function fI(e){const n=sg(e),s=e.options.bulletOther;if(!s)return n==="*"?"-":"*";if(s!=="*"&&s!=="+"&&s!=="-")throw new Error("Cannot serialize items with `"+s+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(s===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+s+"`) to be different");return s}function gI(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function w3(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function xI(e,n,s,r){const i=s.enter("list"),a=s.bulletCurrent;let l=e.ordered?gI(s):sg(s);const c=e.ordered?l==="."?")":".":fI(s);let u=n&&s.bulletLastUsed?l===s.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(u=!0),w3(s)===l&&m){let p=-1;for(;++p<e.children.length;){const x=e.children[p];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(l=c),s.bulletCurrent=l;const h=s.containerFlow(e,r);return s.bulletLastUsed=l,s.bulletCurrent=a,i(),h}function yI(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function jI(e,n,s,r){const i=yI(s);let a=s.bulletCurrent||sg(s);n&&n.type==="list"&&n.ordered&&(a=(typeof n.start=="number"&&n.start>-1?n.start:1)+(s.options.incrementListMarker===!1?0:n.children.indexOf(e))+a);let l=a.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=s.createTracker(r);c.move(a+" ".repeat(l-a.length)),c.shift(l);const u=s.enter("listItem"),h=s.indentLines(s.containerFlow(e,c.current()),m);return u(),h;function m(p,x,g){return x?(g?"":" ".repeat(l))+p:(g?a:a+" ".repeat(l-a.length))+p}}function kI(e,n,s,r){const i=s.enter("paragraph"),a=s.enter("phrasing"),l=s.containerPhrasing(e,r);return a(),i(),l}const vI=Fl(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function bI(e,n,s,r){return(e.children.some(function(l){return vI(l)})?s.containerPhrasing:s.containerFlow).call(s,e,r)}function wI(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}N3.peek=NI;function N3(e,n,s,r){const i=wI(s),a=s.enter("strong"),l=s.createTracker(r),c=l.move(i+i);let u=l.move(s.containerPhrasing(e,{after:i,before:c,...l.current()}));const h=u.charCodeAt(0),m=Yd(r.before.charCodeAt(r.before.length-1),h,i);m.inside&&(u=dl(h)+u.slice(1));const p=u.charCodeAt(u.length-1),x=Yd(r.after.charCodeAt(0),p,i);x.inside&&(u=u.slice(0,-1)+dl(p));const g=l.move(i+i);return a(),s.attentionEncodeSurroundingInfo={after:x.outside,before:m.outside},c+u+g}function NI(e,n,s){return s.options.strong||"*"}function SI(e,n,s,r){return s.safe(e.value,r)}function CI(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function $I(e,n,s){const r=(w3(s)+(s.options.ruleSpaces?" ":"")).repeat(CI(s));return s.options.ruleSpaces?r.slice(0,-1):r}const S3={blockquote:Qq,break:U2,code:nI,definition:rI,emphasis:f3,hardBreak:U2,heading:lI,html:g3,image:x3,imageReference:y3,inlineCode:j3,link:v3,linkReference:b3,list:xI,listItem:jI,paragraph:kI,root:bI,strong:N3,text:SI,thematicBreak:$I};function TI(){return{enter:{table:EI,tableData:H2,tableHeader:H2,tableRow:PI},exit:{codeText:RI,table:AI,tableData:jm,tableHeader:jm,tableRow:jm}}}function EI(e){const n=e._align;this.enter({type:"table",align:n.map(function(s){return s==="none"?null:s}),children:[]},e),this.data.inTable=!0}function AI(e){this.exit(e),this.data.inTable=void 0}function PI(e){this.enter({type:"tableRow",children:[]},e)}function jm(e){this.exit(e)}function H2(e){this.enter({type:"tableCell",children:[]},e)}function RI(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,qI));const s=this.stack[this.stack.length-1];s.type,s.value=n,this.exit(e)}function qI(e,n){return n==="|"?n:e}function II(e){const n=e||{},s=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,a=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
677
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:l,tableCell:u,tableRow:c}};function l(g,j,k,b){return h(m(g,k,b),g.align)}function c(g,j,k,b){const w=p(g,k,b),S=h([w]);return S.slice(0,S.indexOf(`
678
+ `))}function u(g,j,k,b){const w=k.enter("tableCell"),S=k.enter("phrasing"),T=k.containerPhrasing(g,{...b,before:a,after:a});return S(),w(),T}function h(g,j){return Yq(g,{align:j,alignDelimiters:r,padding:s,stringLength:i})}function m(g,j,k){const b=g.children;let w=-1;const S=[],T=j.enter("table");for(;++w<b.length;)S[w]=p(b[w],j,k);return T(),S}function p(g,j,k){const b=g.children;let w=-1;const S=[],T=j.enter("tableRow");for(;++w<b.length;)S[w]=u(b[w],g,j,k);return T(),S}function x(g,j,k){let b=S3.inlineCode(g,j,k);return k.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function FI(){return{exit:{taskListCheckValueChecked:K2,taskListCheckValueUnchecked:K2,paragraph:zI}}}function LI(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:MI}}}function K2(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function zI(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const s=this.stack[this.stack.length-1];s.type;const r=s.children[0];if(r&&r.type==="text"){const i=n.children;let a=-1,l;for(;++a<i.length;){const c=i[a];if(c.type==="paragraph"){l=c;break}}l===s&&(r.value=r.value.slice(1),r.value.length===0?s.children.shift():s.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,s.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function MI(e,n,s,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=s.createTracker(r);a&&c.move(l);let u=S3.listItem(e,n,s,{...r,...c.current()});return a&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),u;function h(m){return m+l}}function OI(){return[gq(),zq(),Dq(),TI(),FI()]}function _I(e){return{extensions:[xq(),Mq(e),Bq(),II(e),LI()]}}const DI={tokenize:VI,partial:!0},C3={tokenize:YI,partial:!0},$3={tokenize:GI,partial:!0},T3={tokenize:QI,partial:!0},BI={tokenize:ZI,partial:!0},E3={name:"wwwAutolink",tokenize:HI,previous:P3},A3={name:"protocolAutolink",tokenize:KI,previous:R3},sr={name:"emailAutolink",tokenize:UI,previous:q3},Ms={};function WI(){return{text:Ms}}let ii=48;for(;ii<123;)Ms[ii]=sr,ii++,ii===58?ii=65:ii===91&&(ii=97);Ms[43]=sr;Ms[45]=sr;Ms[46]=sr;Ms[95]=sr;Ms[72]=[sr,A3];Ms[104]=[sr,A3];Ms[87]=[sr,E3];Ms[119]=[sr,E3];function UI(e,n,s){const r=this;let i,a;return l;function l(p){return!Cf(p)||!q3.call(r,r.previous)||rg(r.events)?s(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(p))}function c(p){return Cf(p)?(e.consume(p),c):p===64?(e.consume(p),u):s(p)}function u(p){return p===46?e.check(BI,m,h)(p):p===45||p===95||Qt(p)?(a=!0,e.consume(p),u):m(p)}function h(p){return e.consume(p),i=!0,u}function m(p){return a&&i&&cn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(p)):s(p)}}function HI(e,n,s){const r=this;return i;function i(l){return l!==87&&l!==119||!P3.call(r,r.previous)||rg(r.events)?s(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(DI,e.attempt(C3,e.attempt($3,a),s),s)(l))}function a(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(l)}}function KI(e,n,s){const r=this;let i="",a=!1;return l;function l(p){return(p===72||p===104)&&R3.call(r,r.previous)&&!rg(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(p),e.consume(p),c):s(p)}function c(p){if(cn(p)&&i.length<5)return i+=String.fromCodePoint(p),e.consume(p),c;if(p===58){const x=i.toLowerCase();if(x==="http"||x==="https")return e.consume(p),u}return s(p)}function u(p){return p===47?(e.consume(p),a?h:(a=!0,u)):s(p)}function h(p){return p===null||Hd(p)||rt(p)||yi(p)||Tu(p)?s(p):e.attempt(C3,e.attempt($3,m),s)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(p)}}function VI(e,n,s){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),a):s(l)}function a(l){return l===null?s(l):n(l)}}function YI(e,n,s){let r,i,a;return l;function l(h){return h===46||h===95?e.check(T3,u,c)(h):h===null||rt(h)||yi(h)||h!==45&&Tu(h)?u(h):(a=!0,e.consume(h),l)}function c(h){return h===95?r=!0:(i=r,r=void 0),e.consume(h),l}function u(h){return i||r||!a?s(h):n(h)}}function GI(e,n){let s=0,r=0;return i;function i(l){return l===40?(s++,e.consume(l),i):l===41&&r<s?a(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(T3,n,a)(l):l===null||rt(l)||yi(l)?n(l):(e.consume(l),i)}function a(l){return l===41&&r++,e.consume(l),i}}function QI(e,n,s){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),a):c===93?(e.consume(c),i):c===60||c===null||rt(c)||yi(c)?n(c):s(c)}function i(c){return c===null||c===40||c===91||rt(c)||yi(c)?n(c):r(c)}function a(c){return cn(c)?l(c):s(c)}function l(c){return c===59?(e.consume(c),r):cn(c)?(e.consume(c),l):s(c)}}function ZI(e,n,s){return r;function r(a){return e.consume(a),i}function i(a){return Qt(a)?s(a):n(a)}}function P3(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||rt(e)}function R3(e){return!cn(e)}function q3(e){return!(e===47||Cf(e))}function Cf(e){return e===43||e===45||e===46||e===95||Qt(e)}function rg(e){let n=e.length,s=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){s=!0;break}if(r._gfmAutolinkLiteralWalkedInto){s=!1;break}}return e.length>0&&!s&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const XI={tokenize:aF,partial:!0};function JI(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:sF,continuation:{tokenize:rF},exit:iF}},text:{91:{name:"gfmFootnoteCall",tokenize:nF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:eF,resolveTo:tF}}}}function eF(e,n,s){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){l=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return c;function c(u){if(!l||!l._balanced)return s(u);const h=fs(r.sliceSerialize({start:l.end,end:r.now()}));return h.codePointAt(0)!==94||!a.includes(h.slice(1))?s(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),n(u))}}function tF(e,n){let s=e.length;for(;s--;)if(e[s][1].type==="labelImage"&&e[s][0]==="enter"){e[s][1];break}e[s+1][1].type="data",e[s+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[s+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[s+3][1].end),end:Object.assign({},e[s+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},c=[e[s+1],e[s+2],["enter",r,n],e[s+3],e[s+4],["enter",i,n],["exit",i,n],["enter",a,n],["enter",l,n],["exit",l,n],["exit",a,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(s,e.length-s+1,...c),e}function nF(e,n,s){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,l;return c;function c(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?s(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(p){if(a>999||p===93&&!l||p===null||p===91||rt(p))return s(p);if(p===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return i.includes(fs(r.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):s(p)}return rt(p)||(l=!0),a++,e.consume(p),p===92?m:h}function m(p){return p===91||p===92||p===93?(e.consume(p),a++,h):h(p)}}function sF(e,n,s){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,l=0,c;return u;function u(j){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(j),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(j){return j===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(j),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):s(j)}function m(j){if(l>999||j===93&&!c||j===null||j===91||rt(j))return s(j);if(j===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return a=fs(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(j),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return rt(j)||(c=!0),l++,e.consume(j),j===92?p:m}function p(j){return j===91||j===92||j===93?(e.consume(j),l++,m):m(j)}function x(j){return j===58?(e.enter("definitionMarker"),e.consume(j),e.exit("definitionMarker"),i.includes(a)||i.push(a),Ve(e,g,"gfmFootnoteDefinitionWhitespace")):s(j)}function g(j){return n(j)}}function rF(e,n,s){return e.check(Il,n,e.attempt(XI,n,s))}function iF(e){e.exit("gfmFootnoteDefinition")}function aF(e,n,s){const r=this;return Ve(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?n(a):s(a)}}function oF(e){let s=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return s==null&&(s=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,c){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let h=u;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[u][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[u][1].end)},p={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[u][1].start)},x=[["enter",m,c],["enter",l[h][1],c],["exit",l[h][1],c],["enter",p,c]],g=c.parser.constructs.insideSpan.null;g&&Ln(x,x.length,0,Eu(g,l.slice(h+1,u),c)),Ln(x,x.length,0,[["exit",p,c],["enter",l[u][1],c],["exit",l[u][1],c],["exit",m,c]]),Ln(l,h-1,u-h+3,x),u=h+x.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function a(l,c,u){const h=this.previous,m=this.events;let p=0;return x;function x(j){return h===126&&m[m.length-1][1].type!=="characterEscape"?u(j):(l.enter("strikethroughSequenceTemporary"),g(j))}function g(j){const k=wa(h);if(j===126)return p>1?u(j):(l.consume(j),p++,g);if(p<2&&!s)return u(j);const b=l.exit("strikethroughSequenceTemporary"),w=wa(j);return b._open=!w||w===2&&!!k,b._close=!k||k===2&&!!w,c(j)}}}class lF{constructor(){this.map=[],this.index=new Map}add(n,s,r){cF(this,n,s,r)}consume(n){if(this.map.sort(function(a,l){return a[0]-l[0]}),this.map.length===0)return;let s=this.map.length;const r=[];for(;s>0;)s-=1,r.push(n.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),n.length=this.map[s][0];r.push(n.slice()),n.length=0;let i=r.pop();for(;i;){for(const a of i)n.push(a);i=r.pop()}this.map.length=0,this.index.clear()}}function cF(e,n,s,r){if(s===0&&r.length===0)return;const i=e.index.get(n);if(i){i[1]+=s,i[2].push(...r);return}const a=[n,s,r];e.map.push(a),e.index.set(n,a)}function dF(e,n){let s=!1;const r=[];for(;n<e.length;){const i=e[n];if(s){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(s=!0);n+=1}return r}function uF(){return{flow:{null:{name:"table",tokenize:hF,resolveAll:pF}}}}function hF(e,n,s){const r=this;let i=0,a=0,l;return c;function c(F){let U=r.events.length-1;for(;U>-1;){const{type:M}=r.events[U][1];if(M==="lineEnding"||M==="linePrefix")U--;else break}const I=U>-1?r.events[U][1].type:null,D=I==="tableHead"||I==="tableRow"?$:u;return D===$&&r.parser.lazy[r.now().line]?s(F):D(F)}function u(F){return e.enter("tableHead"),e.enter("tableRow"),h(F)}function h(F){return F===124||(l=!0,a+=1),m(F)}function m(F){return F===null?s(F):qe(F)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),g):s(F):We(F)?Ve(e,m,"whitespace")(F):(a+=1,l&&(l=!1,i+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),p(F)))}function p(F){return F===null||F===124||rt(F)?(e.exit("data"),m(F)):(e.consume(F),F===92?x:p)}function x(F){return F===92||F===124?(e.consume(F),p):p(F)}function g(F){return r.interrupt=!1,r.parser.lazy[r.now().line]?s(F):(e.enter("tableDelimiterRow"),l=!1,We(F)?Ve(e,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):j(F))}function j(F){return F===45||F===58?b(F):F===124?(l=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),k):z(F)}function k(F){return We(F)?Ve(e,b,"whitespace")(F):b(F)}function b(F){return F===58?(a+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),w):F===45?(a+=1,w(F)):F===null||qe(F)?E(F):z(F)}function w(F){return F===45?(e.enter("tableDelimiterFiller"),S(F)):z(F)}function S(F){return F===45?(e.consume(F),S):F===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(F))}function T(F){return We(F)?Ve(e,E,"whitespace")(F):E(F)}function E(F){return F===124?j(F):F===null||qe(F)?!l||i!==a?z(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(F)):z(F)}function z(F){return s(F)}function $(F){return e.enter("tableRow"),P(F)}function P(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),P):F===null||qe(F)?(e.exit("tableRow"),n(F)):We(F)?Ve(e,P,"whitespace")(F):(e.enter("data"),L(F))}function L(F){return F===null||F===124||rt(F)?(e.exit("data"),P(F)):(e.consume(F),F===92?W:L)}function W(F){return F===92||F===124?(e.consume(F),L):L(F)}}function pF(e,n){let s=-1,r=!0,i=0,a=[0,0,0,0],l=[0,0,0,0],c=!1,u=0,h,m,p;const x=new lF;for(;++s<e.length;){const g=e[s],j=g[1];g[0]==="enter"?j.type==="tableHead"?(c=!1,u!==0&&(V2(x,n,u,h,m),m=void 0,u=0),h={type:"table",start:Object.assign({},j.start),end:Object.assign({},j.end)},x.add(s,0,[["enter",h,n]])):j.type==="tableRow"||j.type==="tableDelimiterRow"?(r=!0,p=void 0,a=[0,0,0,0],l=[0,s+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},j.start),end:Object.assign({},j.end)},x.add(s,0,[["enter",m,n]])),i=j.type==="tableDelimiterRow"?2:m?3:1):i&&(j.type==="data"||j.type==="tableDelimiterMarker"||j.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(a[1]!==0&&(l[0]=l[1],p=sd(x,n,a,i,void 0,p),a=[0,0,0,0]),l[2]=s)):j.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(l[0]=l[1],p=sd(x,n,a,i,void 0,p)),a=l,l=[a[1],s,0,0])):j.type==="tableHead"?(c=!0,u=s):j.type==="tableRow"||j.type==="tableDelimiterRow"?(u=s,a[1]!==0?(l[0]=l[1],p=sd(x,n,a,i,s,p)):l[1]!==0&&(p=sd(x,n,l,i,s,p)),i=0):i&&(j.type==="data"||j.type==="tableDelimiterMarker"||j.type==="tableDelimiterFiller")&&(l[3]=s)}for(u!==0&&V2(x,n,u,h,m),x.consume(n.events),s=-1;++s<n.events.length;){const g=n.events[s];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=dF(n.events,s))}return e}function sd(e,n,s,r,i,a){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";s[0]!==0&&(a.end=Object.assign({},la(n.events,s[0])),e.add(s[0],0,[["exit",a,n]]));const u=la(n.events,s[1]);if(a={type:l,start:Object.assign({},u),end:Object.assign({},u)},e.add(s[1],0,[["enter",a,n]]),s[2]!==0){const h=la(n.events,s[2]),m=la(n.events,s[3]),p={type:c,start:Object.assign({},h),end:Object.assign({},m)};if(e.add(s[2],0,[["enter",p,n]]),r!==2){const x=n.events[s[2]],g=n.events[s[3]];if(x[1].end=Object.assign({},g[1].end),x[1].type="chunkText",x[1].contentType="text",s[3]>s[2]+1){const j=s[2]+1,k=s[3]-s[2]-1;e.add(j,k,[])}}e.add(s[3]+1,0,[["exit",p,n]])}return i!==void 0&&(a.end=Object.assign({},la(n.events,i)),e.add(i,0,[["exit",a,n]]),a=void 0),a}function V2(e,n,s,r,i){const a=[],l=la(n.events,s);i&&(i.end=Object.assign({},l),a.push(["exit",i,n])),r.end=Object.assign({},l),a.push(["exit",r,n]),e.add(s+1,0,a)}function la(e,n){const s=e[n],r=s[0]==="enter"?"start":"end";return s[1][r]}const mF={name:"tasklistCheck",tokenize:gF};function fF(){return{text:{91:mF}}}function gF(e,n,s){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?s(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),a)}function a(u){return rt(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),l):s(u)}function l(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):s(u)}function c(u){return qe(u)?n(u):We(u)?e.check({tokenize:xF},n,s)(u):s(u)}}function xF(e,n,s){return Ve(e,r,"whitespace");function r(i){return i===null?s(i):n(i)}}function yF(e){return Hw([WI(),JI(),oF(e),uF(),fF()])}const jF={};function ig(e){const n=this,s=e||jF,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(yF(s)),a.push(OI()),l.push(_I(s))}function I3(e){var n,s,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(n=0;n<i;n++)e[n]&&(s=I3(e[n]))&&(r&&(r+=" "),r+=s)}else for(s in e)e[s]&&(r&&(r+=" "),r+=s);return r}function F3(){for(var e,n,s=0,r="",i=arguments.length;s<i;s++)(e=arguments[s])&&(n=I3(e))&&(r&&(r+=" "),r+=n);return r}var kF=Object.create,Ru=Object.defineProperty,vF=Object.defineProperties,bF=Object.getOwnPropertyDescriptor,wF=Object.getOwnPropertyDescriptors,L3=Object.getOwnPropertyNames,Gd=Object.getOwnPropertySymbols,NF=Object.getPrototypeOf,ag=Object.prototype.hasOwnProperty,z3=Object.prototype.propertyIsEnumerable,Y2=(e,n,s)=>n in e?Ru(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s,As=(e,n)=>{for(var s in n||(n={}))ag.call(n,s)&&Y2(e,s,n[s]);if(Gd)for(var s of Gd(n))z3.call(n,s)&&Y2(e,s,n[s]);return e},qu=(e,n)=>vF(e,wF(n)),M3=(e,n)=>{var s={};for(var r in e)ag.call(e,r)&&n.indexOf(r)<0&&(s[r]=e[r]);if(e!=null&&Gd)for(var r of Gd(e))n.indexOf(r)<0&&z3.call(e,r)&&(s[r]=e[r]);return s},SF=(e,n)=>function(){return n||(0,e[L3(e)[0]])((n={exports:{}}).exports,n),n.exports},CF=(e,n)=>{for(var s in n)Ru(e,s,{get:n[s],enumerable:!0})},$F=(e,n,s,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of L3(n))!ag.call(e,i)&&i!==s&&Ru(e,i,{get:()=>n[i],enumerable:!(r=bF(n,i))||r.enumerable});return e},TF=(e,n,s)=>(s=e!=null?kF(NF(e)):{},$F(!e||!e.__esModule?Ru(s,"default",{value:e,enumerable:!0}):s,e)),EF=SF({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,n){var s=(function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,a={},l={util:{encode:function j(k){return k instanceof c?new c(k.type,j(k.content),k.alias):Array.isArray(k)?k.map(j):k.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(j){return Object.prototype.toString.call(j).slice(8,-1)},objId:function(j){return j.__id||Object.defineProperty(j,"__id",{value:++i}),j.__id},clone:function j(k,b){b=b||{};var w,S;switch(l.util.type(k)){case"Object":if(S=l.util.objId(k),b[S])return b[S];w={},b[S]=w;for(var T in k)k.hasOwnProperty(T)&&(w[T]=j(k[T],b));return w;case"Array":return S=l.util.objId(k),b[S]?b[S]:(w=[],b[S]=w,k.forEach(function(E,z){w[z]=j(E,b)}),w);default:return k}},getLanguage:function(j){for(;j;){var k=r.exec(j.className);if(k)return k[1].toLowerCase();j=j.parentElement}return"none"},setLanguage:function(j,k){j.className=j.className.replace(RegExp(r,"gi"),""),j.classList.add("language-"+k)},isActive:function(j,k,b){for(var w="no-"+k;j;){var S=j.classList;if(S.contains(k))return!0;if(S.contains(w))return!1;j=j.parentElement}return!!b}},languages:{plain:a,plaintext:a,text:a,txt:a,extend:function(j,k){var b=l.util.clone(l.languages[j]);for(var w in k)b[w]=k[w];return b},insertBefore:function(j,k,b,w){w=w||l.languages;var S=w[j],T={};for(var E in S)if(S.hasOwnProperty(E)){if(E==k)for(var z in b)b.hasOwnProperty(z)&&(T[z]=b[z]);b.hasOwnProperty(E)||(T[E]=S[E])}var $=w[j];return w[j]=T,l.languages.DFS(l.languages,function(P,L){L===$&&P!=j&&(this[P]=T)}),T},DFS:function j(k,b,w,S){S=S||{};var T=l.util.objId;for(var E in k)if(k.hasOwnProperty(E)){b.call(k,E,k[E],w||E);var z=k[E],$=l.util.type(z);$==="Object"&&!S[T(z)]?(S[T(z)]=!0,j(z,b,null,S)):$==="Array"&&!S[T(z)]&&(S[T(z)]=!0,j(z,b,E,S))}}},plugins:{},highlight:function(j,k,b){var w={code:j,grammar:k,language:b};if(l.hooks.run("before-tokenize",w),!w.grammar)throw new Error('The language "'+w.language+'" has no grammar.');return w.tokens=l.tokenize(w.code,w.grammar),l.hooks.run("after-tokenize",w),c.stringify(l.util.encode(w.tokens),w.language)},tokenize:function(j,k){var b=k.rest;if(b){for(var w in b)k[w]=b[w];delete k.rest}var S=new m;return p(S,S.head,j),h(j,S,k,S.head,0),g(S)},hooks:{all:{},add:function(j,k){var b=l.hooks.all;b[j]=b[j]||[],b[j].push(k)},run:function(j,k){var b=l.hooks.all[j];if(!(!b||!b.length))for(var w=0,S;S=b[w++];)S(k)}},Token:c};function c(j,k,b,w){this.type=j,this.content=k,this.alias=b,this.length=(w||"").length|0}c.stringify=function j(k,b){if(typeof k=="string")return k;if(Array.isArray(k)){var w="";return k.forEach(function($){w+=j($,b)}),w}var S={type:k.type,content:j(k.content,b),tag:"span",classes:["token",k.type],attributes:{},language:b},T=k.alias;T&&(Array.isArray(T)?Array.prototype.push.apply(S.classes,T):S.classes.push(T)),l.hooks.run("wrap",S);var E="";for(var z in S.attributes)E+=" "+z+'="'+(S.attributes[z]||"").replace(/"/g,"&quot;")+'"';return"<"+S.tag+' class="'+S.classes.join(" ")+'"'+E+">"+S.content+"</"+S.tag+">"};function u(j,k,b,w){j.lastIndex=k;var S=j.exec(b);if(S&&w&&S[1]){var T=S[1].length;S.index+=T,S[0]=S[0].slice(T)}return S}function h(j,k,b,w,S,T){for(var E in b)if(!(!b.hasOwnProperty(E)||!b[E])){var z=b[E];z=Array.isArray(z)?z:[z];for(var $=0;$<z.length;++$){if(T&&T.cause==E+","+$)return;var P=z[$],L=P.inside,W=!!P.lookbehind,F=!!P.greedy,U=P.alias;if(F&&!P.pattern.global){var I=P.pattern.toString().match(/[imsuy]*$/)[0];P.pattern=RegExp(P.pattern.source,I+"g")}for(var D=P.pattern||P,M=w.next,Y=S;M!==k.tail&&!(T&&Y>=T.reach);Y+=M.value.length,M=M.next){var ae=M.value;if(k.length>j.length)return;if(!(ae instanceof c)){var H=1,Z;if(F){if(Z=u(D,Y,j,W),!Z||Z.index>=j.length)break;var ee=Z.index,ue=Z.index+Z[0].length,q=Y;for(q+=M.value.length;ee>=q;)M=M.next,q+=M.value.length;if(q-=M.value.length,Y=q,M.value instanceof c)continue;for(var B=M;B!==k.tail&&(q<ue||typeof B.value=="string");B=B.next)H++,q+=B.value.length;H--,ae=j.slice(Y,q),Z.index-=Y}else if(Z=u(D,0,ae,W),!Z)continue;var ee=Z.index,O=Z[0],ke=ae.slice(0,ee),pe=ae.slice(ee+O.length),xe=Y+ae.length;T&&xe>T.reach&&(T.reach=xe);var Te=M.prev;ke&&(Te=p(k,Te,ke),Y+=ke.length),x(k,Te,H);var Ee=new c(E,L?l.tokenize(O,L):O,U,O);if(M=p(k,Te,Ee),pe&&p(k,M,pe),H>1){var Fe={cause:E+","+$,reach:xe};h(j,k,b,M.prev,Y,Fe),T&&Fe.reach>T.reach&&(T.reach=Fe.reach)}}}}}}function m(){var j={value:null,prev:null,next:null},k={value:null,prev:j,next:null};j.next=k,this.head=j,this.tail=k,this.length=0}function p(j,k,b){var w=k.next,S={value:b,prev:k,next:w};return k.next=S,w.prev=S,j.length++,S}function x(j,k,b){for(var w=k.next,S=0;S<b&&w!==j.tail;S++)w=w.next;k.next=w,w.prev=k,j.length-=S}function g(j){for(var k=[],b=j.head.next;b!==j.tail;)k.push(b.value),b=b.next;return k}return l})();n.exports=s,s.default=s}}),se=TF(EF());se.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},se.languages.markup.tag.inside["attr-value"].inside.entity=se.languages.markup.entity,se.languages.markup.doctype.inside["internal-subset"].inside=se.languages.markup,se.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(se.languages.markup.tag,"addInlined",{value:function(e,r){var s={},s=(s["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:se.languages[r]},s.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}}),r=(s["language-"+r]={pattern:/[\s\S]+/,inside:se.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:s},se.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(se.languages.markup.tag,"addAttribute",{value:function(e,n){se.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:se.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),se.languages.html=se.languages.markup,se.languages.mathml=se.languages.markup,se.languages.svg=se.languages.markup,se.languages.xml=se.languages.extend("markup",{}),se.languages.ssml=se.languages.xml,se.languages.atom=se.languages.xml,se.languages.rss=se.languages.xml,(function(e){var n={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},s=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+s.source+")",r=RegExp(r+"-"+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:s,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:s}},"special-escape":n,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:s,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(se),se.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},se.languages.javascript=se.languages.extend("clike",{"class-name":[se.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),se.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,se.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:se.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:se.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:se.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:se.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:se.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),se.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:se.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),se.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),se.languages.markup&&(se.languages.markup.tag.addInlined("script","javascript"),se.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),se.languages.js=se.languages.javascript,se.languages.actionscript=se.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),se.languages.actionscript["class-name"].alias="function",delete se.languages.actionscript.parameter,delete se.languages.actionscript["literal-property"],se.languages.markup&&se.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:se.languages.markup}}),(function(e){var n=/#(?!\{).+/,s={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:n,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:s}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:n,interpolation:s}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:s}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript})(se),(function(e){var n=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(n,"addSupport",{value:function(s,r){(s=typeof s=="string"?[s]:s).forEach(function(i){var a=function(p){p.inside||(p.inside={}),p.inside.rest=r},l="doc-comment";if(c=e.languages[i]){var c,u=c[l];if((u=u||(c=e.languages.insertBefore(i,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[l])instanceof RegExp&&(u=c[l]={pattern:u}),Array.isArray(u))for(var h=0,m=u.length;h<m;h++)u[h]instanceof RegExp&&(u[h]={pattern:u[h]}),a(u[h]);else a(u)}})}}),n.addSupport(["java","javascript","php"],n)})(se),(function(e){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,n=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))})(se),(function(e){var n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,n=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:n={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=n,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),s={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:n,number:s,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:n,number:s})})(se),(function(e){var n=/[*&][^\s[\]{},]+/,s=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+s.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+s.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function l(c,u){u=(u||"").replace(/m/g,"")+"m";var h=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return c});return RegExp(h,u)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:l(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:l(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:l(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:l(a),lookbehind:!0,greedy:!0},number:{pattern:l(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:s,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(se),(function(e){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function s(h){return h=h.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+h+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,l=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:s(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:s(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:s(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:s(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(h){["url","bold","italic","strike","code-snippet"].forEach(function(m){h!==m&&(e.languages.markdown[h].inside.content.inside[m]=e.languages.markdown[m])})}),e.hooks.add("after-tokenize",function(h){h.language!=="markdown"&&h.language!=="md"||(function m(p){if(p&&typeof p!="string")for(var x=0,g=p.length;x<g;x++){var j,k=p[x];k.type!=="code"?m(k.content):(j=k.content[1],k=k.content[3],j&&k&&j.type==="code-language"&&k.type==="code-block"&&typeof j.content=="string"&&(j=j.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),j="language-"+(j=(/[a-z][\w-]*/i.exec(j)||[""])[0].toLowerCase()),k.alias?typeof k.alias=="string"?k.alias=[k.alias,j]:k.alias.push(j):k.alias=[j]))}})(h.tokens)}),e.hooks.add("wrap",function(h){if(h.type==="code-block"){for(var m="",p=0,x=h.classes.length;p<x;p++){var g=h.classes[p],g=/language-(.+)/.exec(g);if(g){m=g[1];break}}var j,k=e.languages[m];k?h.content=e.highlight((function(b){return b=b.replace(l,""),b=b.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(w,S){var T;return(S=S.toLowerCase())[0]==="#"?(T=S[1]==="x"?parseInt(S.slice(2),16):Number(S.slice(1)),u(T)):c[S]||w})})(h.content),k,m):m&&m!=="none"&&e.plugins.autoloader&&(j="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),h.attributes.id=j,e.plugins.autoloader.loadLanguages(m,function(){var b=document.getElementById(j);b&&(b.innerHTML=e.highlight(b.textContent,e.languages[m],m))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),c={amp:"&",lt:"<",gt:">",quot:'"'},u=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown})(se),se.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:se.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},se.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var n=e.tokens.filter(function(j){return typeof j!="string"&&j.type!=="comment"&&j.type!=="scalar"}),s=0;s<n.length;){var r=n[s++];if(r.type==="keyword"&&r.content==="mutation"){var i=[];if(p(["definition-mutation","punctuation"])&&m(1).content==="("){s+=2;var a=x(/^\($/,/^\)$/);if(a===-1)continue;for(;s<a;s++){var l=m(0);l.type==="variable"&&(g(l,"variable-input"),i.push(l.content))}s=a+1}if(p(["punctuation","property-query"])&&m(0).content==="{"&&(s++,g(m(0),"property-mutation"),0<i.length)){var c=x(/^\{$/,/^\}$/);if(c!==-1)for(var u=s;u<c;u++){var h=n[u];h.type==="variable"&&0<=i.indexOf(h.content)&&g(h,"variable-input")}}}}function m(j){return n[s+j]}function p(j,k){k=k||0;for(var b=0;b<j.length;b++){var w=m(b+k);if(!w||w.type!==j[b])return}return 1}function x(j,k){for(var b=1,w=s;w<n.length;w++){var S=n[w],T=S.content;if(S.type==="punctuation"&&typeof T=="string"){if(j.test(T))b++;else if(k.test(T)&&--b===0)return w}}return-1}function g(j,k){var b=j.alias;b?Array.isArray(b)||(j.alias=b=[b]):j.alias=b=[],b.push(k)}}),se.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(e){var n=e.languages.javascript["template-string"],s=n.pattern.source,r=n.inside.interpolation,i=r.inside["interpolation-punctuation"],a=r.pattern.source;function l(p,x){if(e.languages[p])return{pattern:RegExp("((?:"+x+")\\s*)"+s),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:p}}}}function c(p,x,g){return p={code:p,grammar:x,language:g},e.hooks.run("before-tokenize",p),p.tokens=e.tokenize(p.code,p.grammar),e.hooks.run("after-tokenize",p),p.tokens}function u(p,x,g){var b=e.tokenize(p,{interpolation:{pattern:RegExp(a),lookbehind:!0}}),j=0,k={},b=c(b.map(function(S){if(typeof S=="string")return S;for(var T,E,S=S.content;p.indexOf((E=j++,T="___"+g.toUpperCase()+"_"+E+"___"))!==-1;);return k[T]=S,T}).join(""),x,g),w=Object.keys(k);return j=0,(function S(T){for(var E=0;E<T.length;E++){if(j>=w.length)return;var z,$,P,L,W,F,U,I=T[E];typeof I=="string"||typeof I.content=="string"?(z=w[j],(U=(F=typeof I=="string"?I:I.content).indexOf(z))!==-1&&(++j,$=F.substring(0,U),W=k[z],P=void 0,(L={})["interpolation-punctuation"]=i,(L=e.tokenize(W,L)).length===3&&((P=[1,1]).push.apply(P,c(L[1],e.languages.javascript,"javascript")),L.splice.apply(L,P)),P=new e.Token("interpolation",L,r.alias,W),L=F.substring(U+z.length),W=[],$&&W.push($),W.push(P),L&&(S(F=[L]),W.push.apply(W,F)),typeof I=="string"?(T.splice.apply(T,[E,1].concat(W)),E+=W.length-1):I.content=W)):(U=I.content,Array.isArray(U)?S(U):S([U]))}})(b),new e.Token(g,b,"language-"+g,p)}e.languages.javascript["template-string"]=[l("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),l("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),l("svg",/\bsvg/.source),l("markdown",/\b(?:markdown|md)/.source),l("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),l("sql",/\bsql/.source),n].filter(Boolean);var h={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function m(p){return typeof p=="string"?p:Array.isArray(p)?p.map(m).join(""):m(p.content)}e.hooks.add("after-tokenize",function(p){p.language in h&&(function x(g){for(var j=0,k=g.length;j<k;j++){var b,w,S,T=g[j];typeof T!="string"&&(b=T.content,Array.isArray(b)?T.type==="template-string"?(T=b[1],b.length===3&&typeof T!="string"&&T.type==="embedded-code"&&(w=m(T),T=T.alias,T=Array.isArray(T)?T[0]:T,S=e.languages[T])&&(b[1]=u(w,S,T))):x(b):typeof b!="string"&&x([b]))}})(p.tokens)})})(se),(function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var n=e.languages.extend("typescript",{});delete n["class-name"],e.languages.typescript["class-name"].inside=n,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),e.languages.ts=e.languages.typescript})(se),(function(e){var n=e.languages.javascript,s=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+s+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:n,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return s})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+s),lookbehind:!0,inside:{string:n.string,number:n.number,boolean:n.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:n,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)})(se),(function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(se),se.languages.n4js=se.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),se.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),se.languages.n4jsd=se.languages.n4js,(function(e){function n(l,c){return RegExp(l.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),c)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:n(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:n(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:n(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var s=["function","function-variable","method","method-variable","property-access"],r=0;r<s.length;r++){var a=s[r],i=e.languages.javascript[a],a=(i=e.util.type(i)==="RegExp"?e.languages.javascript[a]={pattern:i}:i).inside||{};(i.inside=a)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(se),(function(e){var n=e.util.clone(e.languages.javascript),s=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function a(u,h){return u=u.replace(/<S>/g,function(){return s}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(u,h)}i=a(i).source,e.languages.jsx=e.languages.extend("markup",n),e.languages.jsx.tag.pattern=a(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=n.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:a(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:a(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function l(u){for(var h=[],m=0;m<u.length;m++){var p=u[m],x=!1;typeof p!="string"&&(p.type==="tag"&&p.content[0]&&p.content[0].type==="tag"?p.content[0].content[0].content==="</"?0<h.length&&h[h.length-1].tagName===c(p.content[0].content[1])&&h.pop():p.content[p.content.length-1].content!=="/>"&&h.push({tagName:c(p.content[0].content[1]),openedBraces:0}):0<h.length&&p.type==="punctuation"&&p.content==="{"?h[h.length-1].openedBraces++:0<h.length&&0<h[h.length-1].openedBraces&&p.type==="punctuation"&&p.content==="}"?h[h.length-1].openedBraces--:x=!0),(x||typeof p=="string")&&0<h.length&&h[h.length-1].openedBraces===0&&(x=c(p),m<u.length-1&&(typeof u[m+1]=="string"||u[m+1].type==="plain-text")&&(x+=c(u[m+1]),u.splice(m+1,1)),0<m&&(typeof u[m-1]=="string"||u[m-1].type==="plain-text")&&(x=c(u[m-1])+x,u.splice(m-1,1),m--),u[m]=new e.Token("plain-text",x,null,x)),p.content&&typeof p.content!="string"&&l(p.content)}}var c=function(u){return u?typeof u=="string"?u:typeof u.content=="string"?u.content:u.content.map(c).join(""):""};e.hooks.add("after-tokenize",function(u){u.language!=="jsx"&&u.language!=="tsx"||l(u.tokens)})})(se),(function(e){var n=e.util.clone(e.languages.typescript),n=(e.languages.tsx=e.languages.extend("jsx",n),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0})(se),se.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},se.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=se.languages.swift}),(function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var n={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:n},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:n},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin})(se),se.languages.c=se.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),se.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),se.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},se.languages.c.string],char:se.languages.c.char,comment:se.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:se.languages.c}}}}),se.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete se.languages.c.boolean,se.languages.objectivec=se.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete se.languages.objectivec["class-name"],se.languages.objc=se.languages.objectivec,se.languages.reason=se.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),se.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete se.languages.reason.function,(function(e){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,s=0;s<2;s++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(se),se.languages.go=se.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),se.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete se.languages.go["class-name"],(function(e){var n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,s=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return s})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])})(se),se.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},se.languages.python["string-interpolation"].inside.interpolation.inside.rest=se.languages.python,se.languages.py=se.languages.python,se.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},se.languages.webmanifest=se.languages.json;var ul={};CF(ul,{dracula:()=>PF,duotoneDark:()=>qF,duotoneLight:()=>FF,github:()=>zF,gruvboxMaterialDark:()=>hL,gruvboxMaterialLight:()=>mL,jettwaveDark:()=>rL,jettwaveLight:()=>aL,nightOwl:()=>OF,nightOwlLight:()=>DF,oceanicNext:()=>WF,okaidia:()=>HF,oneDark:()=>lL,oneLight:()=>dL,palenight:()=>VF,shadesOfPurple:()=>GF,synthwave84:()=>ZF,ultramin:()=>JF,vsDark:()=>O3,vsLight:()=>nL});var AF={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},PF=AF,RF={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},qF=RF,IF={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},FF=IF,LF={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},zF=LF,MF={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},OF=MF,_F={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},DF=_F,Pn={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},BF={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:Pn.keyword}},{types:["attr-value"],style:{color:Pn.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:Pn.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:Pn.primitive}},{types:["boolean"],style:{color:Pn.boolean}},{types:["tag"],style:{color:Pn.tag}},{types:["string"],style:{color:Pn.string}},{types:["punctuation"],style:{color:Pn.string}},{types:["selector","char","builtin","inserted"],style:{color:Pn.char}},{types:["function"],style:{color:Pn.function}},{types:["operator","entity","url","variable"],style:{color:Pn.variable}},{types:["keyword"],style:{color:Pn.keyword}},{types:["atrule","class-name"],style:{color:Pn.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},WF=BF,UF={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},HF=UF,KF={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},VF=KF,YF={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},GF=YF,QF={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},ZF=QF,XF={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},JF=XF,eL={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},O3=eL,tL={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},nL=tL,sL={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},rL=sL,iL={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},aL=iL,oL={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},lL=oL,cL={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},dL=cL,uL={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},hL=uL,pL={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},mL=pL,fL=e=>N.useCallback(n=>{var s=n,{className:r,style:i,line:a}=s,l=M3(s,["className","style","line"]);const c=qu(As({},l),{className:F3("token-line",r)});return typeof e=="object"&&"plain"in e&&(c.style=e.plain),typeof i=="object"&&(c.style=As(As({},c.style||{}),i)),c},[e]),gL=e=>{const n=N.useCallback(({types:s,empty:r})=>{if(e!=null){{if(s.length===1&&s[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(s.length===1&&r!=null)return e[s[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...s.map(i=>e[i]))}},[e]);return N.useCallback(s=>{var r=s,{token:i,className:a,style:l}=r,c=M3(r,["token","className","style"]);const u=qu(As({},c),{className:F3("token",...i.types,a),children:i.content,style:n(i)});return l!=null&&(u.style=As(As({},u.style||{}),l)),u},[n])},xL=/\r\n|\r|\n/,G2=e=>{e.length===0?e.push({types:["plain"],content:`
679
+ `,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
680
+ `,e[0].empty=!0)},Q2=(e,n)=>{const s=e.length;return s>0&&e[s-1]===n?e:e.concat(n)},yL=e=>{const n=[[]],s=[e],r=[0],i=[e.length];let a=0,l=0,c=[];const u=[c];for(;l>-1;){for(;(a=r[l]++)<i[l];){let h,m=n[l];const x=s[l][a];if(typeof x=="string"?(m=l>0?m:["plain"],h=x):(m=Q2(m,x.type),x.alias&&(m=Q2(m,x.alias)),h=x.content),typeof h!="string"){l++,n.push(m),s.push(h),r.push(0),i.push(h.length);continue}const g=h.split(xL),j=g.length;c.push({types:m,content:g[0]});for(let k=1;k<j;k++)G2(c),u.push(c=[]),c.push({types:m,content:g[k]})}l--,n.pop(),s.pop(),r.pop(),i.pop()}return G2(c),u},Z2=yL,jL=({prism:e,code:n,grammar:s,language:r})=>N.useMemo(()=>{if(s==null)return Z2([n]);const i={code:n,grammar:s,language:r,tokens:[]};return e.hooks.run("before-tokenize",i),i.tokens=e.tokenize(n,s),e.hooks.run("after-tokenize",i),Z2(i.tokens)},[n,s,r,e]),kL=(e,n)=>{const{plain:s}=e,r=e.styles.reduce((i,a)=>{const{languages:l,style:c}=a;return l&&!l.includes(n)||a.types.forEach(u=>{const h=As(As({},i[u]),c);i[u]=h}),i},{});return r.root=s,r.plain=qu(As({},s),{backgroundColor:void 0}),r},vL=kL,bL=({children:e,language:n,code:s,theme:r,prism:i})=>{const a=n.toLowerCase(),l=vL(r,a),c=fL(l),u=gL(l),h=i.languages[a],m=jL({prism:i,language:a,code:s,grammar:h});return e({tokens:m,className:`prism-code language-${a}`,style:l!=null?l.root:{},getLineProps:c,getTokenProps:u})},_3=e=>N.createElement(bL,qu(As({},e),{prism:e.prism||se,theme:e.theme||O3,code:e.code,language:e.language}));/*! Bundled license information:
681
+
682
+ prismjs/prism.js:
683
+ (**
684
+ * Prism: Lightweight, robust, elegant syntax highlighting
685
+ *
686
+ * @license MIT <https://opensource.org/licenses/MIT>
687
+ * @author Lea Verou <https://lea.verou.me>
688
+ * @namespace
689
+ * @public
690
+ *)
691
+ */const wL=/^\s*(?:flowchart|graph)\s*(LR|RL|TD|TB|BT)?\s*;?\s*$/i,NL=/^([A-Za-z0-9_؀-ۿ-]+)\s*(\[\[(.+?)\]\]|\(\[(.+?)\]\)|\(\((.+?)\)\)|\[(.+?)\]|\((.+?)\)|\{(.+?)\}|>(.+?)\])?/,SL=/^\s*(-->|---|-\.->|-\.-|==>|===|--\s*(.+?)\s*-->|-\.\s*(.+?)\s*\.->|==\s*(.+?)\s*==>)\s*(?:\|(.+?)\|)?\s*/;function X2(e){return e.replace(/^["']|["']$/g,"").replace(/<br\s*\/?>/gi," ").trim()}function CL(e){const n=e.split(`
692
+ `).map(x=>x.replace(/%%.*$/,"").trim()).filter(Boolean),s=n.shift()?.match(wL);if(!s)return null;const r=(s[1]??"TD").toUpperCase(),i=new Map,a=[],l=x=>{const g=x.match(NL);if(!g)return null;const j=g[1],k=g[3]??g[4]??g[5]??g[6]??g[7]??g[8]??g[9],b=g[8]?"decision":g[6]||g[3]?"box":k?"round":"box",w=i.get(j);return(!w||k)&&i.set(j,{id:j,text:X2(k??w?.text??j),shape:k?b:w?.shape??b}),{id:j,rest:x.slice(g[0].length)}};for(const x of n)if(!/^(classDef|class|style|linkStyle|click|subgraph|end|direction)\b/.test(x))for(const g of x.split(";").map(j=>j.trim()).filter(Boolean)){let j=l(g);if(!j)continue;let k=j.rest;for(;;){const b=k.match(SL);if(!b)break;const w=l(k.slice(b[0].length));if(!w)break;const S=X2(b[5]??b[2]??b[3]??b[4]??"");a.push({from:j.id,to:w.id,...S?{label:S}:{},...b[1].includes(".")?{dashed:!0}:{}}),j=w,k=w.rest}}if(!i.size)return null;const c=new Map([...i.keys()].map(x=>[x,0]));for(let x=0;x<i.size;x+=1){let g=!1;for(const j of a){if(j.from===j.to)continue;const k=(c.get(j.from)??0)+1;k>(c.get(j.to)??0)&&k<i.size&&(c.set(j.to,k),g=!0)}if(!g)break}const u=new Map,h=[...i.values()].map(x=>{const g=c.get(x.id)??0,j=u.get(g)??0;return u.set(g,j+1),{...x,rank:g,slot:j}}),m=r==="RL"||r==="BT",p=Math.max(...h.map(x=>x.rank));return{across:r==="LR"||r==="RL",nodes:m?h.map(x=>({...x,rank:p-x.rank})):h,edges:a}}function Mr({text:e,ticket:n,stream:s,caret:r}){const[i,a]=N.useState(null),l=N.useMemo(()=>[[m1,{stream:s,caret:r}]],[s,r]);return t.jsxs("div",{className:"cmd",children:[t.jsx(eg,{remarkPlugins:[ig],rehypePlugins:l,components:{a:({href:c,children:u})=>t.jsx("a",{href:c,target:"_blank",rel:"noreferrer",children:u}),img:({src:c,alt:u})=>{const h=c?/^(https?:|data:)/.test(c)?c:In(n,c):"";return t.jsx("button",{className:"cimg",onClick:()=>a(h),"aria-label":`Open ${u||"the picture"} big`,children:t.jsx("img",{src:h,alt:u??"",loading:"lazy"})})},table:({node:c,children:u})=>t.jsx("div",{className:"ctable",children:t.jsx("table",{dir:c?.properties?.dir??void 0,children:u})}),pre:({node:c})=>t.jsx($L,{node:c})},children:e}),i&&t.jsx(zs,{pictures:[{src:i,caption:"Picture"}],start:0,onClose:()=>a(null)})]})}function D3(e){return e.type==="text"?e.value??"":(e.children??[]).map(D3).join("")}function $L({node:e}){const n=e.children?.find(a=>a.tagName==="code"),r=(n?.properties?.className??[]).find(a=>a.startsWith("language-"))?.slice(9)??"",i=D3(n??e).replace(/\n$/,"");if(r==="mermaid"){const a=CL(i);if(a)return t.jsx(EL,{chart:a})}return t.jsx(TL,{lang:r==="mermaid"?"Diagram (Mermaid)":r,code:i})}function TL({lang:e,code:n}){const{theme:s,toast:r}=Le(),i=()=>void navigator.clipboard?.writeText(n).then(()=>r("Code copied"),()=>r("Could not copy. Select the text instead.","err"));return t.jsxs("div",{className:"ccode",dir:"ltr",children:[t.jsxs("div",{className:"ccode-h",children:[t.jsx("span",{children:e||"text"}),t.jsxs("button",{className:"cact",onClick:i,"aria-label":"Copy the code",children:[t.jsx(Mn,{size:13})," Copy"]})]}),t.jsx(_3,{code:n,language:e||"text",theme:s==="dark"?ul.vsDark:ul.github,children:({tokens:a,getLineProps:l,getTokenProps:c})=>t.jsx("pre",{children:a.map((u,h)=>t.jsx("div",{...l({line:u}),children:u.map((m,p)=>t.jsx("span",{...c({token:m})},p))},h))})})]})}function EL({chart:e}){const n=N.useRef(null),[s,r]=N.useState([]),i=N.useMemo(()=>{const l=[];for(const c of e.nodes)(l[c.rank]??=[]).push(c);return l.map(c=>(c??[]).sort((u,h)=>u.slot-h.slot))},[e]),a=N.useMemo(()=>new Set(e.nodes.filter(l=>!e.edges.some(c=>c.from===l.id)).map(l=>l.id)),[e]);return N.useLayoutEffect(()=>{const l=n.current;if(!l)return;const c=()=>{const h=l.getBoundingClientRect(),m=p=>l.querySelector(`[data-node="${CSS.escape(p)}"]`)?.getBoundingClientRect();r(e.edges.flatMap(p=>{const x=m(p.from),g=m(p.to);if(!x||!g)return[];const j=e.across?g.left>=x.right-1:g.top>=x.bottom-1;let k,b,w,S,T;if(e.across){k=(j?x.right:x.left)-h.left,b=x.top+x.height/2-h.top,w=(j?g.left:g.right)-h.left,S=g.top+g.height/2-h.top;const E=Math.max(24,Math.abs(w-k)/2)*(j?1:-1);T=`M${k},${b} C${k+E},${b} ${w-E},${S} ${w},${S}`}else{k=x.left+x.width/2-h.left,b=(j?x.bottom:x.top)-h.top,w=g.left+g.width/2-h.left,S=(j?g.top:g.bottom)-h.top;const E=Math.max(18,Math.abs(S-b)/2)*(j?1:-1);T=`M${k},${b} C${k},${b+E} ${w},${S-E} ${w},${S}`}return[{d:T,x:(k+w)/2,y:(b+S)/2,...p.label?{label:p.label}:{},...p.dashed?{dashed:!0}:{}}]}))};c();const u=new ResizeObserver(c);return u.observe(l),()=>u.disconnect()},[e]),t.jsx("div",{className:"cdiagram",dir:"ltr",children:t.jsxs("div",{ref:n,className:`cflow ${e.across?"across":"down"}`,children:[t.jsxs("svg",{className:"cflow-lines","aria-hidden":"true",children:[t.jsx("defs",{children:t.jsx("marker",{id:"cflow-arrow",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:t.jsx("path",{d:"M0,0 L10,5 L0,10 z"})})}),s.map((l,c)=>t.jsx("path",{d:l.d,className:l.dashed?"dash":"",markerEnd:"url(#cflow-arrow)"},c))]}),i.map((l,c)=>t.jsx("div",{className:"cflow-rank",children:l.map(u=>t.jsx("span",{"data-node":u.id,className:`cnode ${u.shape} ${a.has(u.id)&&u.shape!=="decision"?"end":""}`,children:t.jsx("bdi",{children:u.text})},u.id))},c)),s.map((l,c)=>l.label?t.jsx("span",{className:"cflow-label",style:{left:l.x,top:l.y},children:l.label},c):null)]})})}function AL({lines:e,children:n}){const[s,r]=N.useState(!1);return e<=26?t.jsx(t.Fragment,{children:n}):t.jsxs("div",{className:`cfold ${s?"open":""}`,children:[t.jsx("div",{className:"cfold-body",children:n}),t.jsx("button",{className:"btn sm",onClick:()=>r(!s),children:s?"Show less":`Show all · ${e} lines`})]})}function PL(e){return e.split(`
693
+ `).reduce((n,s)=>n+(s.trim()?Math.ceil(s.length/80):0),0)}function RL({t:e,role:n,text:s,size:r,onShown:i}){const a=Jb(s,!0);return N.useEffect(()=>i(a.shown),[a.shown,i]),t.jsxs("div",{className:`cag cmsg ag-${n}`,children:[t.jsx(ms,{role:n,live:!0}),t.jsxs("div",{className:"cwho",children:[t.jsx("b",{children:ct[n]}),t.jsx("span",{className:"shim",children:"Writing"})]}),t.jsx("div",{className:"cagb",children:t.jsx(Mr,{text:Fd(s,a.shown),ticket:e.id,stream:!0,caret:!0})}),r==="phone"&&t.jsxs("span",{className:"cmeta",children:[ct[n]," · now"]})]})}function qL({p:e}){const n=tt(e.text);return t.jsxs("div",{className:"cyou cmsg",children:[t.jsxs("div",{className:"cybub",children:[e.files.length>0&&t.jsx("div",{className:"cup",children:e.files.map((s,r)=>t.jsxs("div",{className:"cup-row",children:[s.preview?t.jsx("img",{className:"cup-img",src:s.preview,alt:""}):t.jsx("span",{className:"cfic sm file",children:(s.name.split(".").pop()??"").toUpperCase().slice(0,4)}),t.jsx("span",{className:"cfname",children:s.name}),t.jsx("span",{className:"cbar",children:t.jsx("i",{})})]},r))}),e.text.trim()&&t.jsx("p",{className:Fs(n),dir:n.dir,lang:n.dir==="rtl"?"ar":"en",children:e.text})]}),t.jsx("span",{className:"cmeta",children:"You · now · sending"})]})}function IL({story:e,m:n}){const s=re(),r=Fa(n.text),i=Wr[r];return n.big?t.jsxs("div",{className:"sizehint",dir:r==="ar"?"rtl":"ltr",lang:r,children:[t.jsx(Jv,{size:13,"aria-hidden":"true"}),t.jsx(R,{text:n.big==="brd"?i.big.brd:i.big.few}),n.big==="brd"&&(n.breakdown?t.jsx(ge,{to:"/requirements/$id",params:{id:n.breakdown},className:"linkbtn",children:n.breakdown}):t.jsx("button",{className:"linkbtn",disabled:s.isPending,onClick:()=>s.mutate({path:`/api/v1/tickets/${e}/chat/requirements`,body:{at:n.at}}),children:i.brd.send}))]}):null}const $f=/\.(png|jpe?g|gif|webp|bmp)$/i,J2=/\.(mp4|webm|mov|m4v)$/i,Tf=/\.(ogg|opus|oga|m4a|mp3|wav|aac|amr|flac|weba)$/i,B3=/\.(md|markdown)$/i,W3=/\.pdf$/i,U3=/\.html?$/i;function Tr(e){return e.split(/[\\/]/).pop()??e}function H3(e){return B3.test(e)?{cls:"md",label:"MD"}:W3.test(e)?{cls:"pdf",label:"PDF"}:U3.test(e)?{cls:"html",label:"HTML"}:$f.test(e)?{cls:"img",label:(e.split(".").pop()??"IMG").toUpperCase().slice(0,4)}:{cls:"file",label:(e.split(".").pop()??"FILE").toUpperCase().slice(0,4)}}function og({ticket:e,files:n,from:s,onOpen:r,sent:i}){const[a,l]=N.useState(null),[c,u]=N.useState(null),h=n.filter(g=>$f.test(g)),m=n.filter(g=>J2.test(g)),p=n.filter(g=>Tf.test(g)),x=n.filter(g=>!$f.test(g)&&!J2.test(g)&&!Tf.test(g)&&!/\.transcript\.txt$/.test(g));return t.jsxs("div",{className:"cfiles",children:[h.length>0&&t.jsx("div",{className:"cshots",children:h.map((g,j)=>t.jsxs("button",{className:"cshot",onClick:()=>l(j),"aria-label":`Open ${Tr(g)} big`,children:[t.jsx("img",{src:In(e,g),alt:Tr(g),loading:"lazy"}),i&&t.jsx("span",{className:"cshot-ok",title:"Sent",children:t.jsx(ce,{size:11,strokeWidth:3})})]},g))}),m.map(g=>t.jsxs("div",{className:"cvideo",children:[t.jsx("video",{src:In(e,g),controls:!0,preload:"metadata"}),t.jsx(K3,{ticket:e,file:g})]},g)),p.map(g=>t.jsx(LL,{ticket:e,file:g},g)),x.map(g=>{const j=H3(g),k=B3.test(g),b=W3.test(g),w=U3.test(g),S=k?"Markdown · opens beside the chat":b?"PDF · opens beside the chat":w?"Mockup · runs here, sealed off":"File · downloads",T=t.jsxs(t.Fragment,{children:[t.jsx("span",{className:`cfic ${j.cls}`,children:j.label}),t.jsxs("span",{className:"cfile-t",children:[t.jsx("span",{className:"cfname",children:Tr(g)}),t.jsx("span",{className:"cfmeta",children:S})]}),t.jsx("span",{className:"cfopen",children:k||b||w?"Open":t.jsx(gs,{size:14})})]});return k||b?t.jsx("button",{className:"cfile",onClick:()=>r?.({ticket:e,file:g,kind:k?"md":"pdf",...s?{from:s}:{}}),children:T},g):w?t.jsx("button",{className:"cfile",onClick:E=>u({file:g,from:E.currentTarget}),children:T},g):t.jsx("a",{className:"cfile",href:In(e,g),download:!0,children:T},g)}),a!==null&&t.jsx(zs,{pictures:h.map(g=>({src:In(e,g),caption:Tr(g)})),start:a,onClose:()=>l(null)}),c&&t.jsx(dw,{ticket:e,file:c.file,title:Tr(c.file),opener:c.from,onClose:()=>u(null)})]})}function FL(e,n){return ve({queryKey:["transcript",e,n],queryFn:async()=>{const s=await fetch(In(e,`${n}.transcript.txt`));return s.ok&&(await s.text()).replace(/^Transcript of [^\n]*\n+/,"").trim()||null},staleTime:3e4,refetchInterval:s=>s.state.data?!1:1e4})}function K3({ticket:e,file:n,open:s=!0}){const r=FL(e,n).data,[i,a]=N.useState(s);return r?t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"ctlink",onClick:()=>a(!i),children:i?"Hide the written text":"Show the written text"}),i&&t.jsx("div",{className:"ctrans",children:r.split(/\n+/).map((l,c)=>{const u=tt(l);return t.jsx("p",{dir:u.dir,lang:u.dir==="rtl"?"ar":"en",className:Fs(u),children:l},c)})})]}):null}function LL({ticket:e,file:n}){const s=N.useRef(null),[r,i]=N.useState(!1),[a,l]=N.useState({at:0,length:0}),c=N.useMemo(()=>{let p=7;for(const x of n)p=(p*31+x.charCodeAt(0))%9973;return Array.from({length:34},(x,g)=>6+p*(g+3)*7%19)},[n]);N.useEffect(()=>{const p=s.current;if(!p)return;const x=()=>l({at:p.currentTime,length:Number.isFinite(p.duration)?p.duration:0}),g=()=>i(!1);return p.addEventListener("timeupdate",x),p.addEventListener("loadedmetadata",x),p.addEventListener("ended",g),()=>{p.removeEventListener("timeupdate",x),p.removeEventListener("loadedmetadata",x),p.removeEventListener("ended",g)}},[]);const u=()=>{const p=s.current;p&&(r?p.pause():p.play().catch(()=>i(!1)),i(!r))},h=r||a.at>0?a.at:a.length,m=a.length?Math.min(1,a.at/a.length):0;return t.jsxs("div",{className:"cvoice-w",children:[t.jsxs("div",{className:"cvoice",children:[t.jsx("button",{className:"cplay",onClick:u,"aria-label":r?"Pause the voice note":"Play the voice note",children:r?t.jsx(Nl,{size:15,fill:"currentColor"}):t.jsx(kn,{size:15,fill:"currentColor"})}),t.jsx("div",{className:"cwave","aria-hidden":"true",children:c.map((p,x)=>t.jsx("i",{style:{height:p},className:x/c.length<m?"on":""},x))}),t.jsx("span",{className:"cvt",children:zL(h)}),t.jsx("audio",{ref:s,src:In(e,n),preload:"metadata"})]}),t.jsx(K3,{ticket:e,file:n})]})}function zL(e){const n=Math.max(0,Math.round(e));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function Iu({doc:e,onClose:n}){const{toast:s}=Le(),r=In(e.ticket,e.file),i=ve({queryKey:["doc",e.ticket,e.file],queryFn:async()=>{const c=await fetch(r);if(!c.ok)throw new Error("The file could not be read.");return c.text()},enabled:e.kind==="md"}),a=H3(e.file),l=()=>void navigator.clipboard?.writeText(i.data??"").then(()=>s("Document copied"));return t.jsxs("section",{className:"cdoc","aria-label":Tr(e.file),children:[t.jsxs("div",{className:"cdoc-h",children:[t.jsx("span",{className:`cfic sm ${a.cls}`,children:a.label}),t.jsxs("div",{className:"grow",children:[t.jsx("div",{className:"cfname",children:Tr(e.file)}),t.jsx("div",{className:"cfmeta",children:e.from??(e.kind==="md"?"Markdown":"PDF")})]}),e.kind==="md"&&t.jsx("button",{className:"btn sm",onClick:l,disabled:!i.data,children:"Copy"}),e.kind==="pdf"&&t.jsx("a",{className:"btn sm",href:r,target:"_blank",rel:"noreferrer",children:"Open in a tab"}),t.jsx("button",{className:"iconbtn",onClick:n,"aria-label":"Close the document",children:t.jsx(Ue,{size:16})})]}),e.kind==="md"?t.jsx("div",{className:"cdoc-b",children:i.isError?t.jsx("p",{className:"note",children:"The file could not be read."}):i.data?t.jsx(Mr,{text:i.data,ticket:e.ticket}):t.jsx("p",{className:"note",children:"Loading…"})}):t.jsx("iframe",{className:"cdoc-pdf",src:r,title:Tr(e.file)})]})}function V3({t:e,m:n,holder:s,onReply:r}){const i=re(),{toast:a}=Le(),[l,c]=N.useState(!1),[u,h]=N.useState(!1),m=()=>{const j=window.getSelection();return((j&&!j.isCollapsed&&s.current?.contains(j.anchorNode)?j.toString().trim():"")||n.text).trim().slice(0,2e3)},p=(j,k)=>{c(!1),i.mutate({path:`/api/v1/tickets/${e.id}/notes`,body:{text:m(),kind:j},done:`Added to the spec as ${k}.`})},x=()=>void navigator.clipboard?.writeText(n.text).then(()=>a("Copied"),()=>a("Could not copy. Select the text instead.","err")),g=()=>r(`> ${n.text.replace(/\s+/g," ").slice(0,160)}${n.text.length>160?"…":""}
694
+
695
+ `);return t.jsxs("div",{className:"cacts",children:[t.jsxs("button",{className:"cact",onClick:x,children:[t.jsx(Mn,{size:13})," Copy"]}),n.who==="you"&&n.text.trim()&&$u(e)&&t.jsxs("button",{className:"cact",onClick:()=>h(!0),children:[t.jsx(Ps,{size:13})," Propose as a change"]}),!tr(e)&&n.text.trim()&&t.jsxs("span",{className:"cmenu-w",children:[t.jsxs("button",{className:"cact",onClick:()=>c(!l),"aria-haspopup":"menu","aria-expanded":l,onMouseDown:j=>j.preventDefault(),children:[t.jsx(jt,{size:13})," Add to spec"]}),l&&t.jsxs("div",{className:"cmenu",role:"menu",onMouseLeave:()=>c(!1),children:[t.jsxs("button",{role:"menuitem",onClick:()=>p("rule","a business rule"),onMouseDown:j=>j.preventDefault(),children:[t.jsx("b",{children:"A business rule"}),t.jsx("small",{children:"Every agent must follow it"})]}),t.jsxs("button",{role:"menuitem",onClick:()=>p("criterion",'a "done when" item'),onMouseDown:j=>j.preventDefault(),children:[t.jsx("b",{children:'A "done when" item'}),t.jsx("small",{children:"The Tester proves it with a screenshot"})]}),t.jsxs("button",{role:"menuitem",onClick:()=>p("note","a note"),onMouseDown:j=>j.preventDefault(),children:[t.jsx("b",{children:"A note"}),t.jsx("small",{children:"Context for the next steps"})]})]})]}),e.chat?.open&&t.jsxs("button",{className:"cact",onClick:g,children:[t.jsx(mS,{size:13})," Reply"]}),u&&t.jsx(Rl,{t:e,initial:n.text,from:e.chat?.with,onClose:()=>h(!1)})]})}function ML(e){let n=!1;return e.split(`
696
+ `).map((s,r,i)=>{/^\s*```/.test(s)&&(n=!n);const a=i[r+1]??"";return!n&&s.trim()&&a.trim()&&!/^\s*([-*+]|\d+\.|>|```)\s/.test(a)?`${s}
697
+ `:s}).join(`
698
+ `)}function OL({t:e,m:n,fresh:s,onOpenDoc:r,onReply:i}){const a=N.useRef(null),[l,c]=N.useState(!1),u=!n.text.trim()&&(n.files??[]).some(h=>Tf.test(h));return t.jsxs("div",{className:`cyou cmsg ${l?"picked":""} ${s?"pop-in":""}`,children:[t.jsxs("div",{className:"cybub",ref:a,onClick:h=>h.currentTarget.contains(h.target)&&c(!l),children:[n.text.trim()&&t.jsx(Mr,{text:ML(n.text),ticket:e.id}),n.files&&n.files.length>0&&t.jsx(og,{ticket:e.id,files:n.files,onOpen:r,sent:!0,from:"From you"})]}),t.jsxs("span",{className:"cmeta",children:["You · ",jd(n.at),u?" · written out from your voice":""]}),t.jsx(V3,{t:e,m:n,holder:a,onReply:i}),n.big&&t.jsx(IL,{story:e.id,m:n})]})}function jd(e){return new Date(e).toDateString()===new Date().toDateString()?tn(e):`${Ls(e)} ${tn(e)}`}function _L({t:e,m:n,size:s,used:r,writing:i,answer:a,canChoose:l,newest:c,onChoose:u,onOther:h,onOpenDoc:m,onReply:p}){const x=N.useRef(null),[g,j]=N.useState(!1),k=n.who,b=ct[k]??"Agent",w=i!==null,S=w?Fd(n.text,i):n.text,T=t.jsx(Mr,{text:S,ticket:e.id,stream:w,caret:w});return t.jsxs("div",{className:`cag cmsg ag-${k} ${g?"picked":""}`,children:[t.jsx(ms,{role:k,live:w}),t.jsxs("div",{className:"cwho",children:[t.jsx("b",{children:b}),w?t.jsx("span",{className:"shim",children:"Writing"}):t.jsx("span",{className:"ctime",children:jd(n.at)})]}),t.jsxs("div",{className:"cagb",ref:x,onClick:E=>s==="phone"&&E.currentTarget.contains(E.target)&&!E.target.closest("button, a")&&j(!g),children:[r.length>0&&t.jsx(WL,{steps:r}),w||c?T:t.jsx(AL,{lines:PL(n.text),children:T}),!w&&n.files&&n.files.length>0&&t.jsx(og,{ticket:e.id,files:n.files,onOpen:m,from:`From the ${b} · ${jd(n.at)}`}),!w&&n.options&&n.options.length>0&&t.jsx(DL,{options:n.options,answer:a,can:l,onChoose:u,onOther:h})]}),!w&&s==="phone"&&t.jsxs("span",{className:"cmeta",children:[b," · ",jd(n.at)]}),!w&&t.jsx(V3,{t:e,m:n,holder:x,onReply:p})]})}function DL({options:e,answer:n,can:s,onChoose:r,onOther:i}){const a=tt(e.join(" ")),l=n?.trim();return t.jsxs("div",{className:"cchoices",dir:a.dir,children:[e.map((c,u)=>{const h=tt(c),m=l?l===c.trim()?"on":"off":s?"":"off";return t.jsx("button",{className:`cch ${m} ${Fs(h)} ${s?"rise":""}`,style:{"--i":u},lang:h.dir==="rtl"?"ar":"en",dir:h.dir,disabled:!s,onClick:()=>r(c),children:c},c)}),s&&t.jsx("button",{className:"cch other rise",style:{"--i":e.length},onClick:i,dir:a.dir,children:a.dir==="rtl"?"إجابة أخرى…":"Something else…"})]})}function BL(e){let n=0,s=0;for(const r of e.content){if(r.type!=="diff")continue;const i=(r.oldText??"").split(`
699
+ `).filter(Boolean).length,a=r.newText.split(`
700
+ `).filter(Boolean).length;n+=Math.max(0,a-(r.oldText==null?0:Math.min(i,a))),s+=r.oldText==null?0:Math.max(0,i-a)}return{title:e.title,...n||s?{plus:n,minus:s}:{}}}function Y3({s:e}){const n=BL(e);return t.jsxs("div",{className:`cstep ${e.skipped?"skipped":e.status}`,children:[e.skipped?t.jsx(Ra,{size:13}):e.status==="completed"?t.jsx(ce,{size:13,strokeWidth:2.5}):e.status==="failed"?t.jsx(Ue,{size:13}):t.jsx(Xe,{size:13,className:"spin"}),t.jsx("span",{className:"cstep-t",children:n.title}),n.plus!==void 0&&t.jsxs("span",{className:"cstep-n",children:[t.jsxs("span",{className:"add",children:["+",n.plus]})," ",t.jsxs("span",{className:"del",children:["−",n.minus]})]})]})}function WL({steps:e}){const[n,s]=N.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"cactv",onClick:()=>s(!n),"aria-expanded":n,children:[t.jsx(hu,{size:13,style:{transform:n?"rotate(90deg)":void 0}})," Looked at ",e.length," ",e.length===1?"thing":"things"]}),n&&t.jsx("div",{className:"cactlist",children:e.map(r=>t.jsx(Y3,{s:r},r.id))})]})}function UL({role:e,steps:n,hasMessage:s}){const r=n.filter(l=>l.status==="in_progress").at(-1)??n.at(-1),i=r?r.title:s?"Reading your message":"Reading the ticket",a=n.slice(-6);return t.jsxs("div",{className:`cag cmsg ag-${e} thinking`,children:[t.jsx(ms,{role:e,live:!0}),t.jsxs("div",{className:"cwho",children:[t.jsx("b",{children:ct[e]}),t.jsx("span",{className:"shim",children:i})]}),t.jsxs("div",{className:"cagb",children:[t.jsxs("span",{className:"cdots","aria-label":`The ${ct[e]} is answering`,children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]}),a.length>0&&t.jsxs("div",{className:"csteps",children:[n.length>a.length&&t.jsxs("div",{className:"cstep more",children:["and ",n.length-a.length," earlier steps"]}),a.map(l=>t.jsx(Y3,{s:l},l.id))]})]})]})}function HL({t:e,m:n,last:s,onAsk:r}){const i=re(),a=n.note==="failed"||!n.note&&n.text.startsWith("Could not answer"),l=e.chat?ct[e.chat.with]:"agent",c=s&&e.chat?.open&&!e.chat.thinking&&(a||n.note==="stopped"),u=()=>i.mutate({path:`/api/v1/tickets/${e.id}/chat/retry`});return a?t.jsxs("div",{className:"cfail cmsg",children:[t.jsxs("div",{className:"cfail-t",children:[t.jsx(Fn,{size:15})," The ",l," could not answer. Nothing was lost.",t.jsx("span",{className:"cfail-why",children:n.text.replace(/^Could not answer:\s*/,"")})]}),c&&t.jsxs("div",{className:"cbtns",children:[t.jsx("button",{className:"btn pri sm",disabled:i.isPending,onClick:u,children:"Try again"}),t.jsx("button",{className:"btn sm",onClick:r,children:"Ask something else"})]})]}):t.jsxs("div",{className:"cnote-w cmsg",children:[t.jsx(R,{as:"div",className:"cnote-pill",text:n.text}),c&&t.jsx("div",{className:"cbtns",children:t.jsx("button",{className:"btn sm",disabled:i.isPending,onClick:u,children:"Ask again"})})]})}function KL(e,n,s){return s&&(!n||ln(e,n))&&!e.takenOver&&!e.deleting&&!e.archived&&e.stage!=="release"&&e.stage!=="done"&&!(e.chat?.open&&!e.chat.beside)}async function lg(e){try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}function cg({prompt:e,inClipboard:n}){return t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note",role:"status",children:n?"Copied. Paste it in a conversation in any AI tool.":"Select these words, copy them, and paste them in a conversation in any AI tool."}),t.jsx("textarea",{className:"waynote prompt-box",rows:9,readOnly:!0,value:e,"aria-label":"The prompt",onFocus:s=>s.target.select()})]})}const G3=["What you spend there is yours: squad-kit does not count it.","squad-kit's guard and limits do not apply there.","When it comes back it keeps a label on its record. You can ask squad-kit to check the work."];function VL({t:e,onClose:n}){const s=re(),r=re(),[i,a]=N.useState(null),l=!i&&!!(e.live||e.squad||e.stopRequested),c=()=>s.mutate({path:`/api/v1/tickets/${e.id}/outside`},{onSuccess:async u=>a({prompt:u.prompt,inClipboard:await lg(u.prompt)})});return t.jsx(Ye,{title:`Work on ${e.id} in another AI tool`,onClose:n,icon:t.jsx("span",{className:"glyph",children:t.jsx(ya,{size:15})}),footer:i?t.jsx("button",{className:"btn pri",onClick:n,children:"Done"}):t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:s.isPending||l,onClick:c,children:[t.jsx(Mn,{size:15})," ",s.isPending?"Getting it ready…":"Copy prompt"]}),l&&t.jsxs("button",{className:"btn",disabled:r.isPending||e.stopRequested,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/stop`,done:"Stopping the squad"}),children:[t.jsx(Jn,{size:13})," ",e.stopRequested?"Stopping…":"Stop"]}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad outside start ${e.id}`})]}),children:i?t.jsx(cg,{prompt:i.prompt,inClipboard:i.inClipboard}):t.jsxs(t.Fragment,{children:[t.jsx("p",{children:"Paste the prompt in a conversation in any AI tool. It goes on from where this story is now, by this project's own structure, and this page shows it at its real step."}),t.jsx("p",{className:"note",children:l?"The squad is working on it right now. Press Stop first, or wait until it needs you.":"The squad keeps off this story until you bring it back."}),t.jsx("ul",{className:"note",children:G3.map(u=>t.jsx("li",{children:u},u))})]})})}function YL(){const e=De(),[n,s]=N.useState(null),[r,i]=N.useState("");if(!(e.data?.ready&&e.data.meta.engine==="live"))return null;const a=async()=>{i("");try{const{prompt:l}=await ye("/api/v1/outside-prompt");s({prompt:l,inClipboard:await lg(l)})}catch(l){i(l instanceof Error?l.message:String(l))}};return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn",onClick:()=>void a(),title:"Copy a prompt, and start this story in a conversation in any AI tool",children:[t.jsx(ya,{size:15})," Start in another AI tool"]}),r&&t.jsx("span",{className:"note",role:"alert",children:r}),n&&t.jsxs(Ye,{title:"Start a story in another AI tool",onClose:()=>s(null),icon:t.jsx("span",{className:"glyph",children:t.jsx(ya,{size:15})}),footer:t.jsx("button",{className:"btn pri",onClick:()=>s(null),children:"Done"}),children:[t.jsx(cg,{prompt:n.prompt,inClipboard:n.inClipboard}),t.jsx("ul",{className:"note",children:G3.map(l=>t.jsx("li",{children:l},l))})]})]})}function GL({t:e,extra:n}){const s=re(),[r,i]=N.useState(null),[a,l]=N.useState(""),c=async()=>{l("");try{const{prompt:u}=await ye(`/api/v1/tickets/${e.id}/outside-prompt`);i({prompt:u,inClipboard:await lg(u)})}catch(u){l(u instanceof Error?u.message:String(u))}};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:t.jsx(ya,{size:15})}),t.jsxs("div",{children:[t.jsx("b",{children:"In a conversation outside squad-kit"}),t.jsx("span",{children:"The squad waits. This page reads the story's files, so it shows the real step."})]})]}),t.jsx("p",{className:"note",style:{fontSize:12.5,marginTop:8},children:"When you are done, bring it back. It comes back at its real step: with code, you can check it and accept it here. With only a spec or a design, you approve that and the squad carries on. If nothing changed, it is as it was."}),a&&t.jsx("p",{className:"note",role:"alert",children:a}),r&&t.jsx(cg,{prompt:r.prompt,inClipboard:r.inClipboard}),n]}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn pri",disabled:s.isPending,onClick:()=>s.mutate({path:`/api/v1/tickets/${e.id}/bring-back`,done:`${e.id} is back on the board.`}),children:[t.jsx(ib,{size:15})," ",s.isPending?"Looking at the work…":"Bring it back"]}),t.jsxs("button",{className:"btn",onClick:()=>void c(),children:[t.jsx(Mn,{size:15})," Copy prompt"]}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad outside back ${e.id}`})]})]})}function Q3(e){return e.from?`Continued outside from ${e.from}`:"Worked outside squad-kit"}const QL="squad-kit trusts only what it ran itself. This story was worked on in a conversation outside it.";function ZL({t:e}){const n=re(),s=e.outside;if(!s)return null;const r=!s.checked&&!e.takenOver&&e.stage!=="release"&&e.stage!=="done"&&xi(e);return t.jsxs("span",{className:"outlabel",children:[t.jsx("span",{className:"prio outside",title:QL,children:Q3(s)}),s.checked&&!e.takenOver?t.jsxs("span",{className:"prio outside checked",title:s.checked.noTests?"squad-kit's checks ran, but the project has no tests. The review and the proof passed.":"squad-kit's own checks, review and proof passed.",children:[t.jsx(ce,{size:11,strokeWidth:3})," ",s.checked.noTests?"Checked, no tests ran":"Checked"]}):r?t.jsx("button",{className:"btn sm tiny",disabled:n.isPending,title:"squad-kit runs its own checks, review and proof on this work. They use AI, like on any story.",onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/check-outside`,done:"squad-kit is checking the work."}),children:"Check"}):null]})}function XL({t:e}){if(!e.outside&&!e.takenOver?.free)return null;const n=!!e.outside?.checked&&!e.takenOver,s=e.takenOver?.free?"In a conversation outside squad-kit":Q3(e.outside);return t.jsx("span",{className:`prio outside${n?" checked":""}`,title:s,children:n?"Outside, checked":"Outside"})}function JL(e){return(e?.options??[]).map((n,s)=>{const r=n.do??(s===0?"retry":void 0);return{index:s,label:n.name,note:n.note,way:r,needs:r==="continue"||r==="skip-hooks"?"reason":r==="yourself"?"fix":null,primary:s===0}})}function ez(e){return e?.title??"The squad stopped and needs you"}function Qd(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:`${n.getDate()} ${n.toLocaleString("en",{month:"short"})} ${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}`}function tz(e){const{notes:n,fixed:s,past:r,open:i}=e.counts;if(!n)return"No notes";const a=[s?`${s} fixed`:"",r?`${r} you went past`:"",i?`${i} open`:""].filter(Boolean);return`${n} ${n===1?"note":"notes"}: ${a.join(", ")}`}function nz(e){return e.file?e.line?`${e.file}:${e.line}`:e.file:"The whole change"}const sz={fixed:"Fixed",past:"Went past",open:"Open"};function rz(e){return e.byItself?`squad-kit accepted it by itself, ${Qd(e.at)}`:`${e.by} approved: Looks right, ${Qd(e.at)}`}function iz({t:e}){const n=ve({queryKey:["review",e.id,e.activity.length],queryFn:()=>ye(`/api/v1/tickets/${e.id}/review`),refetchInterval:e.live?1e4:!1});return n.data?.rounds.length?t.jsx(az,{id:e.id,v:n.data}):null}function az({id:e,v:n}){return t.jsxs("section",{className:"rv","aria-label":"The review",children:[t.jsxs("div",{className:"rv-head",children:[t.jsx("b",{children:"The review"}),t.jsxs("span",{className:"rv-sum",children:[n.rounds.length," ",n.rounds.length===1?"round":"rounds"," · ",tz(n)," · Builder changes after review: ",n.fixes.length?`${n.fixes.length} ${n.fixes.length===1?"commit":"commits"}`:"none"]}),t.jsx("span",{className:"grow"}),t.jsx(dz,{id:e,v:n})]}),n.old&&t.jsx("p",{className:"note",children:"Kept the old way: the latest notes only, with no file or line."}),n.rounds.map(s=>t.jsx(oz,{id:e,r:s,canPast:n.canPast},s.n)),n.looksRight&&t.jsxs("div",{className:"rv-ok",children:[t.jsx("span",{className:"ok",children:t.jsx(ce,{size:12})}),t.jsx("span",{children:rz(n.looksRight)})]}),t.jsx("div",{className:"pills",children:t.jsx(X,{text:`squad review ${e}`})})]})}function oz({id:e,r:n,canPast:s}){return t.jsxs("div",{className:"rv-round",children:[t.jsxs("div",{className:"rv-rhead",children:[t.jsx("span",{className:"r",children:n.n}),t.jsxs("span",{children:["Round ",n.n," · ",Qd(n.at)," · ",n.approved?"approved":"changes asked",n.fix.length?t.jsxs(t.Fragment,{children:[" ","· the Builder's fix ",t.jsx("code",{dir:"ltr",children:n.fix.join(", ")})]}):null]})]}),n.notes.length?n.notes.map(r=>t.jsx(lz,{id:e,n:r,canPast:s},r.n)):t.jsxs("p",{className:"rv-none",children:["Round ",n.n,": no new notes"]})]})}function lz({id:e,n,canPast:s}){const r=n.state==="fixed"?ce:n.state==="past"?Xv:Y9;return t.jsxs("div",{className:`rv-thread ${n.state}`,children:[t.jsxs("div",{className:"rv-file",dir:"ltr",children:[t.jsx("span",{className:"path",children:nz(n)}),t.jsxs("span",{className:`res ${n.state}`,children:[t.jsx(r,{size:12})," ",sz[n.state]]})]}),t.jsxs("div",{className:"rv-note",children:[t.jsx("span",{className:"av",children:"Re"}),t.jsxs("div",{className:"body",children:[t.jsxs("small",{children:[t.jsx("b",{children:"Reviewer"})," · round ",n.round,n.line?` · line ${n.line}`:""," · note ",n.n]}),t.jsx("p",{...ze(n.text),children:n.text}),n.state==="fixed"&&t.jsxs("div",{className:"rv-fixed",children:[t.jsx(ce,{size:13}),n.fixed?.commit?t.jsxs(t.Fragment,{children:["Fixed in ",t.jsx("code",{dir:"ltr",children:n.fixed.commit})]}):"Fixed, the Reviewer says"]}),n.state==="past"&&n.past&&t.jsxs("div",{className:"rv-past",children:[t.jsx("b",{children:"You went past it"}),": ",t.jsx("span",{...ze(n.past.reason),children:n.past.reason}),t.jsxs("small",{children:[n.past.by,", ",Qd(n.past.at)]})]}),n.state==="open"&&n.touched&&t.jsxs("p",{className:"rv-touched",children:["Changed in ",t.jsx("code",{dir:"ltr",children:n.touched}),": the Reviewer says in its next round whether it is fixed"]}),n.state==="open"&&s&&t.jsx(cz,{id:e,n:n.n})]})]})]})}function cz({id:e,n}){const[s,r]=N.useState(!1),[i,a]=N.useState(""),l=re();if(!s)return t.jsxs("button",{className:"btn sm rv-go",onClick:()=>r(!0),children:[t.jsx(Xv,{size:13})," Go past…"]});const c=()=>l.mutate({path:`/api/v1/tickets/${e}/review/past`,body:{note:n,reason:i},done:`Went past note ${n}. Your reason is on the record`,after:()=>r(!1)});return t.jsxs("div",{className:"rv-why",children:[t.jsx("input",{autoFocus:!0,value:i,dir:je(i),placeholder:"Why you go past it. It goes in the pull request too.",onChange:u=>a(u.target.value),onKeyDown:u=>u.key==="Enter"&&i.trim()&&c()}),t.jsx("button",{className:"btn sm pri",disabled:!i.trim()||l.isPending,onClick:c,children:"Go past"}),t.jsx("button",{className:"btn sm",onClick:()=>r(!1),children:"Cancel"}),t.jsx(X,{text:`squad review ${e} --past ${n} --reason "${i.trim()||"<why>"}"`})]})}function dz({id:e,v:n}){const s=re(),r=n.posted;return r?r.ok?t.jsxs("span",{className:"rv-pr ok",children:[t.jsx(mu,{size:13})," In pull request ",r.pr]}):t.jsxs("span",{className:"rv-pr no",children:[t.jsxs("span",{children:["Not in pull request ",r.pr," yet: ",r.why]}),n.canWrite&&t.jsxs("button",{className:"btn sm",disabled:s.isPending,onClick:()=>s.mutate({path:`/api/v1/tickets/${e}/review/write`,done:i=>i.ok?"Wrote the review into the pull request":`Not written: ${i.why??"the code host said no."}`}),children:[t.jsx(fS,{size:13})," Write it again"]}),t.jsx(X,{text:`squad review ${e} --write`})]}):null}const ek={cursor:"Cursor",code:"VS Code"};function Fu({t:e}){const n=re(),r=ve({queryKey:["editors"],queryFn:()=>ye("/api/v1/editors"),staleTime:3e5}).data?.editors[0];return t.jsxs("button",{className:"btn sm",disabled:n.isPending||!e.baseCommit,title:e.baseCommit?void 0:"Nothing built yet",onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/open-editor`,body:r?{editor:r}:{},done:`Opened in ${r?ek[r]:"your editor"}`}),children:[t.jsx(Xt,{size:13})," Open in ",r?ek[r]:"editor"]})}function uz({t:e}){const n=ve({queryKey:["changes",e.id,e.activity.length],queryFn:()=>ye(`/api/v1/tickets/${e.id}/changes`),refetchInterval:e.live?1e4:!1}),s=n.data,r=s?.files.reduce((a,l)=>a+l.added,0)??0,i=s?.files.reduce((a,l)=>a+l.removed,0)??0;return t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"changes-head",children:[t.jsxs("div",{children:[s&&s.files.length>0?t.jsxs(t.Fragment,{children:[t.jsxs("b",{children:[s.files.length," ",s.files.length===1?"file":"files"," changed"]})," ",t.jsxs("span",{className:"add",children:["+",r]})," ",t.jsxs("span",{className:"del",children:["−",i]})]}):t.jsx("b",{children:"Changes"}),t.jsx("p",{className:"note",children:s?.from==="branch"?"Read from its saved work. The copy was removed after the release.":"The squad builds in its own copy of the code, so your folder stays yours. These changes reach your folder after Looks right."})]}),t.jsx("span",{className:"grow"}),t.jsx(Fu,{t:e})]}),t.jsx(iz,{t:e}),n.isLoading&&t.jsx("p",{className:"note",children:"Reading the changes…"}),n.error&&t.jsx("p",{className:"note",children:n.error.message}),s&&!s.files.length&&t.jsx("p",{className:"note",children:s.from==="none"?"Nothing built yet.":"No changes against main yet."}),s?.cut&&t.jsx("p",{className:"note",children:"This change is very large, so some files show only their name. Open it in your editor to see all of it."}),s?.files.map(a=>t.jsx(hz,{f:a},a.path)),t.jsxs("div",{className:"pills",style:{marginTop:12},children:[t.jsx(X,{text:`squad changes ${e.id} --full`}),t.jsx(X,{text:`squad open ${e.id}`})]})]})}function hz({f:e}){const n=e.patch?e.patch.split(`
701
+ `):[],[s,r]=N.useState(n.length<=300);return t.jsxs("div",{className:"conv-diff",children:[t.jsxs("button",{className:"conv-diff-head mono changes-file",onClick:()=>r(!s),children:[t.jsx("span",{className:`fstat ${e.status}`,children:e.status==="added"?"new":e.status==="deleted"?"deleted":e.status==="renamed"?"moved":"changed"}),t.jsx("span",{style:{overflowWrap:"anywhere",textAlign:"left"},children:e.path}),t.jsx("span",{className:"grow"}),e.binary?t.jsx("span",{children:"binary"}):t.jsxs("span",{children:[t.jsxs("span",{className:"add",children:["+",e.added]})," ",t.jsxs("span",{className:"del",children:["−",e.removed]})]})]}),s&&n.length>0&&t.jsx("pre",{children:n.map((i,a)=>i.startsWith("@@")?t.jsx("div",{className:"gap",children:i.replace(/^(@@[^@]*@@).*/,"$1")},a):t.jsxs("div",{className:i.startsWith("+")?"add":i.startsWith("-")?"del":"same",children:[t.jsx("span",{className:"sign",children:i.startsWith("+")?"+":i.startsWith("-")?"−":" "}),i.slice(1)||" "]},a))})]})}function Lu({ticket:e,app:n,small:s,label:r="Report a problem"}){return t.jsxs("button",{className:`btn ${s?"sm":""}`,onClick:()=>Cl.open({...e?{ticket:e}:{},...n?{app:n}:{}}),children:[t.jsx(l1,{size:s?13:14})," ",r]})}function pz(){const e=SS();return e?t.jsx(fz,{ask:e,onClose:Cl.close},`${e.ticket??""}${e.app?"app":""}`):null}function mz(e){return/[\\/]Downloads$/.test(e)?" in your Downloads folder":""}function fz({ask:e,onClose:n}){const{toast:s}=Le(),[r,i]=N.useState(null),[a,l]=N.useState(null),[c,u]=N.useState(""),[h,m]=N.useState(!1),[p,x]=N.useState(null),g=e.app?null:gt,j=new URLSearchParams({...g?{project:g}:{},...g&&e.ticket?{ticket:e.ticket}:{}}).toString();N.useEffect(()=>{let w=!0;return ye(`/api/v1/app/report${j?`?${j}`:""}`).then(S=>w&&i(S)).catch(S=>w&&l(S.message)),()=>{w=!1}},[j]);const k=async()=>{m(!0),l(null);try{x(await et("/api/v1/app/report","POST",{...g?{project:g}:{},...g&&e.ticket?{ticket:e.ticket}:{},...c.trim()?{note:c}:{}}))}catch(w){l(w instanceof Error?w.message:String(w))}finally{m(!1)}},b=w=>{const S=navigator.clipboard?.writeText(w);if(!S)return s("Could not copy. Select the text instead.","err");S.then(()=>s("Copied where the file is"),()=>s("Could not copy. Select the text instead.","err"))};return p?.file?t.jsxs(Ye,{title:"Report saved",onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",onClick:n,children:[t.jsx(ce,{size:15,strokeWidth:2.5})," Done"]}),t.jsxs("button",{className:"btn",onClick:()=>b(p.file),children:[t.jsx(Mn,{size:14})," Copy where it is"]})]}),children:[t.jsxs("div",{className:"report-saved",role:"status",children:[t.jsx("span",{className:"report-ok",children:t.jsx(ce,{size:16,strokeWidth:2.6})}),t.jsxs("div",{children:[t.jsxs("b",{children:["Saved ",p.name,mz(p.folder)]}),t.jsx("span",{className:"mono",children:p.file})]})]}),t.jsx("p",{className:"report-send",children:"Send this file to whoever helps you with squad-kit."}),t.jsx("p",{className:"note",children:"It holds no tokens or passwords. You can open it first to see what is inside: README.txt lists every file."})]}):t.jsxs(Ye,{title:"Report a problem",onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!r||h,onClick:()=>void k(),children:[h?t.jsx(Xe,{size:15,className:"spin"}):t.jsx(l1,{size:15})," ",r?`Save ${r.name}`:"Save the report"]}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),r&&t.jsx(X,{text:r.command})]}),children:[t.jsx("p",{children:"squad-kit saves one file you can send to your engineer or to squad-kit support."}),r?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The file holds"}),t.jsx("ul",{className:"safe-list",children:r.holds.map(w=>t.jsxs("li",{children:[t.jsx(ce,{size:15,strokeWidth:2.6,"aria-hidden":"true"}),w]},w))}),t.jsxs("div",{className:"report-never",children:[t.jsx("b",{children:"Never included:"})," ",r.never.replace(/^Never included:\s*/,"")]})]}):!a&&t.jsx("p",{className:"note",children:"Looking at what the file will hold…"}),t.jsxs("div",{className:"field",style:{marginTop:14},children:[t.jsx("label",{htmlFor:"report-what",children:"What happened? (optional)"}),t.jsx("textarea",{id:"report-what",className:"waynote",rows:3,dir:je(c),value:c,onChange:w=>u(w.target.value),placeholder:"For example: it stopped after I approved the design"})]}),a&&t.jsx("p",{className:"report-err",role:"alert",children:a})]})}function gz(){return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Something wrong?"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx(Lu,{app:!0,small:!0}),t.jsx("span",{className:"note",children:"One file to send: squad-kit's log for the last 24 hours and the versions. Never your tokens or passwords."}),t.jsx(X,{text:"squad report"}),t.jsx(X,{text:"squad logs"})]})]})}const Zd=new Set;let Cr={text:"",context:null,n:0};const dg={get:()=>Cr,open:e=>{Cr={text:e.text??"",context:e.context,n:Cr.n+1},Nt.follow(null),Nt.open("lead");for(const n of Zd)n()},used:()=>{if(!(!Cr.context&&!Cr.text)){Cr={text:"",context:null,n:Cr.n};for(const e of Zd)e()}}};function xz(){return N.useSyncExternalStore(e=>(Zd.add(e),()=>Zd.delete(e)),()=>Cr)}function Ma({size:e=16,className:n}){return t.jsxs("svg",{className:`lucide ${n??""}`,width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"3.5",cy:"12",r:"1.7",fill:"currentColor",fillOpacity:"0.35"}),t.jsx("circle",{cx:"8",cy:"12",r:"1.7",fill:"currentColor",fillOpacity:"0.65"}),t.jsx("circle",{cx:"12.5",cy:"12",r:"1.7",fill:"currentColor"}),t.jsx("path",{d:"M16 6.5 21.5 12 16 17.5",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function ug({title:e,what:n,safe:s=[],ways:r,report:i,hint:a,calm:l,children:c}){return t.jsxs("div",{className:`drafterr errcard${l?" calm":""}`,role:"alert",children:[t.jsx("b",{className:"errcard-title",children:e}),t.jsx("div",{className:"errcard-what",children:n}),s.length>0&&t.jsx("ul",{className:"safe-list",children:s.map(u=>t.jsxs("li",{children:[t.jsx(ce,{size:15,strokeWidth:2.6,"aria-hidden":"true"}),u]},u))}),t.jsx("div",{className:"errcard-lbl",children:"What you can do"}),t.jsxs("div",{className:"drafterr-ways",children:[r.map(u=>t.jsxs("button",{className:`btn ${u.primary?"pri":""}`,disabled:u.disabled,title:u.title,onClick:u.onClick,children:[u.icon,u.label]},u.label)),i!==!1&&t.jsx(Lu,{...i??{}})]}),a&&t.jsx("div",{className:"errcard-hint",children:a}),c]})}function Z3({t:e,extra:n}){const s=re(),[r,i,a]=$e(e.id,"stuck-open",null),[l,c,u]=$e(e.id,"stuck-text",""),h=JL(e.stuck),m=(w,S,T)=>s.mutate({path:`/api/v1/tickets/${e.id}/decide`,body:{choice:w,...S},done:T},{onSuccess:()=>{a(),u()}}),p=h.find(w=>w.way==="retry"),x=r==="reason"||r==="fix"?h.find(w=>w.needs===r):void 0,g=r==="note"&&l.trim()?l.trim():"",j=h.map(w=>({label:w.label,title:w.note,primary:w.primary,disabled:s.isPending,icon:w.way==="retry"?t.jsx(gi,{size:14}):w.way==="yourself"?t.jsx(tl,{size:14}):void 0,onClick:()=>{if(w.needs){i(r===w.needs?null:w.needs),c("");return}m(w.index,w.way==="retry"&&g?{note:g}:{},w.way==="retry"?"Trying again. The squad carries on.":"Decided. The squad carries on.")}})),k=e.stuck?.title??e.stuck?.question;j.push({label:"Ask the lead",title:"It reads what happened and tells you, in plain words. It changes nothing.",icon:t.jsx(Ma,{size:14}),onClick:()=>dg.open({text:vw("error",e.id),context:{from:"problem",problem:"error",story:e.id,...k?{error:k.slice(0,400)}:{}}})});const b=x?`squad decide ${e.id} ${x.index+1}${x.needs==="reason"?` --reason ${Me(l.trim()||"…")}`:""}`:`squad decide ${e.id}${p&&g?` ${p.index+1} --note ${Me(g)}`:""}`;return t.jsxs("div",{className:"db",children:[t.jsx(ug,{title:ez(e.stuck),calm:e.stuck?.kind==="no-tests"||e.stuck?.gate==="cap",what:e.stuck?.points?.length?t.jsxs(t.Fragment,{children:[t.jsx(R,{as:"div",text:e.stuck.question}),t.jsx("ul",{className:"errcard-points",children:e.stuck.points.map(w=>t.jsx(R,{as:"li",text:w},w))})]}):t.jsx(R,{as:"div",text:e.stuck?.question??""}),safe:e.stuck?.safe??["Nothing was lost: the work so far is kept."],ways:j,report:{ticket:e.id},hint:t.jsxs(t.Fragment,{children:[p&&r!=="note"&&t.jsx("button",{className:"linkbtn",onClick:()=>i("note"),children:"Add a note for the squad first"}),e.stuck?.detail?" Engineers: the exact error is in the Developer tab.":""]})}),r==="note"&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"A note for the squad (optional)"}),t.jsx("textarea",{className:"waynote",rows:2,dir:je(l),value:l,onChange:w=>c(w.target.value),placeholder:"For example: the test server needs the VPN, it is on now"}),t.jsxs("p",{className:"note",style:{fontSize:12.5},children:["The squad reads it first when you press ",p?.label??"Try again","."]})]}),r==="reason"&&x&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:x.way==="skip-hooks"?"Why save it without the check?":"Why continue anyway?"}),t.jsx("textarea",{className:"waynote",rows:2,dir:je(l),value:l,onChange:w=>c(w.target.value),placeholder:x.way==="skip-hooks"?"For example: the check needs a licence this laptop does not have":"For example: the failing test is broken on main too, fixed in SK-160"}),t.jsx("p",{className:"note",style:{fontSize:12.5},children:"Only you can do this. Your reason shows on the ticket, the pull request and the release notes."}),t.jsx("div",{className:"errcard-confirm",children:t.jsxs("button",{className:"btn pri",disabled:!l.trim()||s.isPending,onClick:()=>m(x.index,{reason:l},"Decided. The squad carries on."),children:[t.jsx(ce,{size:15,strokeWidth:2.5})," ",x.label]})})]}),r==="fix"&&x&&t.jsxs("div",{className:"stuckbox",style:{marginTop:12},children:[t.jsxs("p",{style:{margin:"0 0 8px"},children:["Open the ticket's copy, fix it, and save. Then press ",t.jsx("b",{children:"I fixed it"}),": the checks, review and proof run again."]}),t.jsxs("div",{className:"errcard-confirm",children:[t.jsx(Fu,{t:e}),t.jsxs("button",{className:"btn pri",disabled:s.isPending,onClick:()=>m(x.index,{},"OK. The checks run again on your fix."),children:[t.jsx(ce,{size:15,strokeWidth:2.5})," I fixed it, check again"]})]})]}),t.jsx("div",{className:"errcard-cmd",children:t.jsx(X,{text:b})}),n]})}function yz({t:e}){const{toast:n}=Le();if(!e.stuck||e.waiting?.kind!=="stuck")return null;const s=e.stuck.detail??e.stuck.question,r=()=>{const i=navigator.clipboard?.writeText(s);if(!i)return n("Could not copy. Select the text instead.","err");i.then(()=>n("Copied the exact error"),()=>n("Could not copy. Select the text instead.","err"))};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The exact error"}),t.jsx("pre",{className:"exact-err",children:s}),t.jsxs("div",{className:"pills",style:{marginTop:8},children:[t.jsxs("button",{className:"btn sm",onClick:r,children:[t.jsx(Mn,{size:13})," Copy"]}),t.jsx(Lu,{ticket:e.id,small:!0}),t.jsx(X,{text:"squad logs --tail"})]})]})}function jz({job:e}){const n=e.draft.split,s=Fa(e.text),r=Wr[s],i=n.size==="few";return t.jsxs("div",{className:"draftsize",dir:s==="ar"?"rtl":"ltr",lang:s,children:[t.jsxs("div",{className:"read",children:[t.jsx(zo,{size:15,"aria-hidden":"true"}),t.jsx("span",{children:i?r.read(n.parts.length):r.brd.read})]}),t.jsxs("section",{className:"decide splitcard","aria-label":i?r.title(n.parts.length):r.brd.title,children:[t.jsxs("div",{className:"dh",children:[t.jsx("b",{children:i?r.title(n.parts.length):r.brd.title}),t.jsx("span",{className:"who",children:r.who})]}),t.jsx("div",{className:"db",children:i?t.jsx(Su,{s:n,w:r}):t.jsx(Cu,{s:n,w:r})})]})]})}function kz({job:e,onOne:n,onCancel:s,onMade:r}){const i=e.draft.split,a=Fa(e.text),l=Wr[a],c=i.size==="few",{toast:u}=Le(),h=_t(),m=re(),p=re(),x=m.isPending||p.isPending,g=()=>m.mutate({path:`/api/v1/tickets/draft/${e.id}/split`},{onSuccess:({tickets:k})=>{const b=k.map(w=>w.id);u(`Created ${I1(b)}. ${b[0]} starts now; the others wait in Tickets until you start them.`),r(k[0])}}),j=()=>p.mutate({path:`/api/v1/tickets/draft/${e.id}/requirements`},{onSuccess:({breakdown:k})=>{u(`Sent to Requirements as ${k.id}. The Analyst reads it first.`),r(),h({to:"/requirements/$id",params:{id:k.id}})}});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sizebar",dir:a==="ar"?"rtl":"ltr",lang:a,children:[t.jsx("button",{className:"btn pri",disabled:x,onClick:c?g:j,children:c?l.create(i.parts.length):l.brd.send}),t.jsx("button",{className:"btn",disabled:x,onClick:()=>n(c?"kept":"brd"),children:c?l.one:l.brd.anyway}),t.jsx("button",{className:"btn",disabled:x,onClick:s,children:l.cancel}),t.jsx("span",{className:"grow"}),t.jsx("span",{className:"note",children:c?l.hint:e.files.length?l.brd.hint:l.brd.hintText})]}),t.jsx(X,{text:`squad new --from "…" ${c?"--split":"--requirements"}`})]})}const tk=10*1024*1024;function zl(e){return new Promise((n,s)=>{const r=new FileReader;r.onload=()=>{const i=String(r.result);n({name:e.name,size:e.size,data:i.slice(i.indexOf(",")+1),...e.type.startsWith("image/")?{preview:i}:{}})},r.onerror=()=>s(new Error(`Could not read ${e.name}`)),r.readAsDataURL(e)})}function vz(e){const n=/\.(png|jpe?g|gif|webp)$/i.exec(e.name)?.[1]?.toLowerCase();return n?{preview:`data:image/${n==="jpg"?"jpeg":n};base64,${e.data}`}:{}}const wt="new-ticket";function nk(){return`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function X3({onClose:e,onCreated:n}){const s=re(),{toast:r}=Le(),[i,a]=$e(wt,"mode","write"),[l,c]=$e(wt,"pasted",""),[u,h]=N.useState(null),[m,p]=N.useState(null),x=u?.status==="working",[g,j]=N.useState(null),[k,b]=N.useState(null),[w,S]=$e(wt,"title",""),[T,E]=$e(wt,"ask",""),[z,$]=$e(wt,"kind","feature"),[P,L]=$e(wt,"priority","normal"),[W,F]=$e(wt,"track","full"),[U,I]=N.useState(!1),[D,M]=$e(wt,"new-tests",!0),Y=De(),ae=!!(Y.data?.ready&&Y.data.meta.alwaysNewTests),H=!D&&!ae,[Z,ue]=N.useState(null),[q,B]=$e(wt,"criteria",[]),[ee,O]=$e(wt,"rules",[]),[ke,pe]=$e(wt,"edge-cases",[]),[xe,Te]=$e(wt,"what",""),[Ee,Fe]=$e(wt,"steps",[]),[Ge,pt]=$e(wt,"expected",""),[sn,On]=$e(wt,"where",""),[dn,js]=$e(wt,"severity","annoying"),qt=z==="bug",[_n,wn]=N.useState(()=>Kj(wt,"create-key",nk)),Nn=N.useRef(!1),[Je,Dt]=N.useState([]),Sn=async ne=>{const dt=[...ne],bs=dt.find(Wn=>Wn.size>tk);bs&&r(`${bs.name} is larger than 10 MB.`,"err");const Cn=await Promise.all(dt.filter(Wn=>Wn.size<=tk).map(zl)).catch(Wn=>(r(Wn.message,"err"),[]));Dt(Wn=>[...Wn,...Cn].slice(0,10))},ks=Je.map(({name:ne,data:dt})=>({name:ne,data:dt})),vs=ne=>{S(ne.title),E(ne.ask),ne.kind==="bug"&&Te(ne.ask),$(ne.kind),L(ne.priority),ne.track&&(F(ne.track),ue(ne.track)),B(ne.criteria),O(ne.rules),pe(ne.edgeCases),j(ne.gaps),a("write")};N.useEffect(()=>{let ne=!0;return ye("/api/v1/tickets/draft/current").then(async({draft:dt})=>{if(!(!ne||!dt)&&(c(dt.text),a("paste"),h(dt),dt.files.length)){const bs=await ye(`/api/v1/tickets/draft/${dt.id}/files`).catch(()=>({files:[]}));ne&&Dt(bs.files.map((Cn,Wn)=>({...Cn,size:dt.files[Wn]?.size??0,...vz(Cn)})))}}).catch(()=>{}),()=>{ne=!1}},[]);const He=ve({queryKey:["ticket-draft",u?.id],queryFn:()=>ye(`/api/v1/tickets/draft/${u.id}`),enabled:x,refetchInterval:1e3,retry:!1});N.useEffect(()=>{He.data&&u?.status==="working"&&He.data.id===u.id&&h(He.data)},[He.data]),N.useEffect(()=>{He.isError&&x&&h(ne=>ne&&{...ne,status:"failed",error:"squad-kit lost this draft, maybe because it restarted."})},[He.isError]);const te=N.useRef(null);N.useEffect(()=>{u?.status==="done"&&u.draft&&te.current!==u.id&&(te.current=u.id,Xj(u.draft)==="one"&&(vs(u.draft),b("checked")))},[u]);const he=async()=>{p(null);try{h(await et("/api/v1/tickets/draft","POST",{text:l,files:ks}))}catch(ne){p(ne instanceof Error?ne.message:String(ne))}},Ae=async()=>{if(u)try{h(await et(`/api/v1/tickets/draft/${u.id}/cancel`,"POST"))}catch{h({...u,status:"cancelled"})}},Oe=()=>{u&&et(`/api/v1/tickets/draft/${u.id}/dismiss`,"POST").catch(()=>{}),h(null)},Ke=()=>{Oe(),p(null),T.trim()||E(l.trim()),xe.trim()||Te(l.trim()),a("write")},Ct=()=>{Oe(),j(null),b(null),ue(null);for(const ne of[S,E,Te,pt,On])ne("");for(const ne of[B,O,pe,Fe])ne([]);a("paste")},ns=()=>{Ct(),c(""),Dt([]),a("write"),$("feature"),L("normal"),F("full"),M(!0),js("annoying"),Jp(gt,wt),wn(Kj(wt,"create-key",nk))},rn=!!(l||w||T||xe||Ge||sn||q.length||ee.length||ke.length||Ee.length),ss=Ee.filter(ne=>ne.trim()),Os=[xe.trim()&&`What happens:
702
+ ${xe.trim()}`,ss.length&&`Steps to see it:
703
+ ${ss.map((ne,dt)=>`${dt+1}. ${ne.trim()}`).join(`
704
+ `)}`,Ge.trim()&&`What should happen:
705
+ ${Ge.trim()}`,sn.trim()&&`Where: ${sn.trim()}`].filter(Boolean).join(`
706
+
707
+ `),Et=qt?{title:w,ask:Os,kind:z,severity:dn,priority:dn==="stops-work"?"high":dn==="small"?"low":"normal",track:W,files:ks,talkFirst:U&&W==="full",noNewTests:H,key:_n,...k?{sized:k}:{}}:{title:w,ask:T,kind:z,track:W,priority:P,criteria:q,rules:ee,edgeCases:ke,files:ks,talkFirst:U&&W==="full",noNewTests:H,key:_n,...k?{sized:k}:{}},Dn=()=>s.mutate({path:"/api/v1/tickets",body:Et,after:()=>{Oe(),Jp(gt,wt)},done:ne=>Nn.current?`${ne.id} is on the board.`:null},{onSuccess:ne=>{n(ne),e()}}),Bt=()=>{s.isPending&&(Nn.current=!0,r("Your ticket is still being made. Closing this does not stop it: it comes onto the board in a moment.")),e()},qi=!!m||u?.status==="failed"||u?.status==="cancelled",Bn=i==="paste"&&u?.status==="done"&&Xj(u.draft)!=="one"&&u.text===l?u:null,rr=i==="paste"?`squad new --from ${Me(l.trim().split(`
708
+ `)[0]?.slice(0,40)||"your message")}`:[`squad new ${Me(w.trim()||"Your title")}`,qt?`--bug --severity ${dn}`:"",qt&&xe.trim()?`--ask ${Me(xe.trim())}`:"",W==="express"?"--express":"",U&&W==="full"?"--talk":"",H?"--no-new-tests":"",...qt?[]:q.filter(ne=>ne.trim()).map(ne=>`--criteria ${Me(ne)}`),...qt?[]:ee.filter(ne=>ne.trim()).map(ne=>`--rule ${Me(ne)}`),...qt?[]:ke.filter(ne=>ne.trim()).map(ne=>`--edge ${Me(ne)}`),...Je.map(ne=>`--attach ${Me(ne.name)}`)].filter(Boolean).join(" ");return t.jsxs(Ye,{title:"New ticket",wide:!0,onClose:Bt,losing:Je.length&&!s.isPending?Je.length===1?"the attached file":`the ${Je.length} attached files`:null,icon:t.jsx("span",{className:"glyph",children:t.jsx(jt,{size:15})}),footer:Bn?t.jsx(kz,{job:Bn,onOne:ne=>{b(ne),vs(Bn.draft)},onCancel:Bt,onMade:ne=>{Jp(gt,wt),ne&&n(ne),e()}}):t.jsxs(t.Fragment,{children:[i==="paste"?qi?null:t.jsxs("button",{className:"btn pri",disabled:!l.trim()&&!Je.length||x,onClick:()=>void he(),children:[x?t.jsx(Xe,{size:15,className:"spin"}):t.jsx(zo,{size:15})," ",x?"Filling in…":"Fill in the ticket"]}):t.jsxs("button",{className:"btn pri",disabled:!w.trim()||s.isPending,onClick:Dn,children:[t.jsx(jt,{size:15})," Create ticket"]}),t.jsx("button",{className:"btn",onClick:x?()=>void Ae():Bt,children:s.isPending?"Close":"Cancel"}),rn&&!x&&t.jsx(xb,{onClear:ns}),!rn&&!x&&t.jsx(YL,{}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:rr})]}),children:[t.jsxs("div",{className:"seg",style:{marginBottom:14,width:"fit-content"},children:[t.jsx("button",{className:i==="write"?"on":"",disabled:x,title:x?"Press Cancel first to write it yourself":void 0,onClick:()=>a("write"),children:"Write it"}),t.jsxs("button",{className:i==="paste"?"on":"",onClick:()=>a("paste"),children:[t.jsx(zo,{size:13,style:{verticalAlign:"-2px",marginRight:5}}),"From an idea or message"]})]}),i==="paste"?t.jsxs(t.Fragment,{children:[!x&&!Bn&&t.jsx("p",{children:"Paste an idea, a WhatsApp message or one line of business. Add screenshots if you have them. The Analyst fills in the ticket, and you check every field before it is created."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-paste",children:"The idea or message"}),t.jsx("textarea",{id:"nt-paste",className:"textarea",style:{minHeight:x||Bn?70:150},autoFocus:!0,readOnly:x,dir:je(l),value:l,onChange:ne=>c(ne.target.value),onPaste:ne=>{ne.clipboardData.files.length&&(ne.preventDefault(),Sn(ne.clipboardData.files))},placeholder:"For example: the manager says clerks should not book more than 3 appointments a day for the same person"})]}),x&&u?t.jsxs(t.Fragment,{children:[Je.length>0&&t.jsxs("p",{className:"note",style:{margin:"-6px 0 12px"},children:["With ",Je.map(ne=>ne.name).join(", ")]}),t.jsx(Nz,{job:u})]}):Bn?Je.length>0&&t.jsxs("p",{className:"note",style:{margin:"-6px 0 12px"},children:["With ",Je.map(ne=>ne.name).join(", ")]}):t.jsx(vm,{files:Je,onAdd:Sn,onRemove:ne=>Dt(dt=>dt.filter((bs,Cn)=>Cn!==ne))}),Bn&&t.jsx(jz,{job:Bn}),qi&&t.jsx(Sz,{error:m??(u?.status==="failed"?u.error??"Something went wrong.":null),onRetry:()=>void he(),onWrite:Ke})]}):t.jsxs(t.Fragment,{children:[g?t.jsxs("div",{className:"drafted",children:[t.jsxs("b",{children:[t.jsx(zo,{size:13})," The Analyst filled this in from your message."]})," Check it and change anything."," ",t.jsx("button",{className:"linkbtn",onClick:Ct,children:"Discard this draft"}),k==="brd"&&t.jsx("div",{style:{marginTop:6},children:Wr[Fa(l)].brd.also}),g.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{marginTop:6},children:"Still unclear, so the Analyst will ask you after you create it:"}),t.jsx("ul",{children:g.map((ne,dt)=>t.jsx(R,{as:"li",text:ne},dt))})]})]}):t.jsx("p",{children:qt?"Say what goes wrong and how to see it. The squad finds the cause and fixes it.":"Write it in plain words. Add what you already know; the Analyst asks you about the rest."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"Kind"}),t.jsx("div",{className:"sevs",children:["feature","bug"].map(ne=>t.jsxs("button",{className:`choice ${z===ne?"on":""}`,onClick:()=>$(ne),children:[t.jsx("span",{className:"rd"}),ne==="feature"?"New feature":"Bug"]},ne))})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-title",children:"Title"}),t.jsx("input",{id:"nt-title",className:"input",autoFocus:!0,dir:je(w),value:w,onChange:ne=>S(ne.target.value),placeholder:qt?"For example: A price written as 1,500 is refused":"For example: Show hearing time in local time"})]}),qt?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-what",children:"What happens"}),t.jsx("textarea",{id:"nt-what",className:"textarea",dir:je(xe),value:xe,onChange:ne=>Te(ne.target.value),placeholder:"For example: the form says the price is not valid."})]}),t.jsx(rd,{label:"Steps to see it",hint:"One step per line, for example: Open Services and add a service.",items:Ee,onChange:Fe,add:"Add a step"}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-expected",children:"What should happen"}),t.jsx("textarea",{id:"nt-expected",className:"textarea",dir:je(Ge),value:Ge,onChange:ne=>pt(ne.target.value),placeholder:"For example: the price is saved as 1,500 SAR."})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-where",children:"Where"}),t.jsx("input",{id:"nt-where",className:"input",dir:je(sn),value:sn,onChange:ne=>On(ne.target.value),placeholder:"The page or link, for example: Setup, Services"})]}),t.jsx(vm,{files:Je,onAdd:Sn,onRemove:ne=>Dt(dt=>dt.filter((bs,Cn)=>Cn!==ne))}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"How bad is it?"}),t.jsx("div",{className:"sevs",children:J3.map(ne=>t.jsxs("button",{className:`choice ${dn===ne.value?"on":""}`,onClick:()=>js(ne.value),children:[t.jsx("span",{className:"rd"}),ne.label]},ne.value))})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"nt-ask",children:"What do you want?"}),t.jsx("textarea",{id:"nt-ask",className:"textarea",dir:je(T),value:T,onChange:ne=>E(ne.target.value),placeholder:"Who needs it, and why. One or two sentences is enough."})]}),t.jsx(rd,{label:"Acceptance criteria",hint:"Each one is something you can check, for example: The clerk sees the time in their own city.",items:q,onChange:B,add:"Add a criterion"}),t.jsx(rd,{label:"Business rules",hint:"Limits and who may do what, for example: Only a team lead can reassign a case.",items:ee,onChange:O,add:"Add a rule"}),t.jsx(rd,{label:"Edge cases",hint:"Unusual cases to handle, for example: The person has no cases yet.",items:ke,onChange:pe,add:"Add an edge case"}),t.jsx(vm,{files:Je,onAdd:Sn,onRemove:ne=>Dt(dt=>dt.filter((bs,Cn)=>Cn!==ne))}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"Priority"}),t.jsx("div",{className:"sevs",children:["high","normal","low"].map(ne=>t.jsxs("button",{className:`choice ${P===ne?"on":""}`,onClick:()=>L(ne),children:[t.jsx("span",{className:"rd"}),ne==="high"?"High":ne==="normal"?"Normal":"Low"]},ne))})]})]}),t.jsxs("div",{className:"field",children:[t.jsxs("label",{children:["Track",Z&&t.jsxs("span",{className:"note",style:{marginLeft:8,fontWeight:400},children:["The Analyst suggests ",Z==="express"?"Express":"Full"]})]}),t.jsx("div",{className:"tracks",children:Cz.map(ne=>t.jsxs("button",{className:`opt2 ${W===ne.id?"pick":""}`,onClick:()=>F(ne.id),children:[t.jsxs("b",{children:[ne.name,W===ne.id&&t.jsxs("span",{children:[t.jsx(ce,{size:13,strokeWidth:2.5})," Chosen"]})]}),ne.note]},ne.id))})]}),W==="full"&&t.jsxs("label",{className:"talkfirst",children:[t.jsx("input",{type:"checkbox",checked:U,onChange:ne=>I(ne.target.checked)}),t.jsxs("span",{children:[t.jsx("b",{children:"Talk it through first."})," The Analyst opens a chat instead of sending questions. The spec is written from your talk when you say so."]})]}),!ae&&t.jsxs("label",{className:"talkfirst",children:[t.jsx("input",{type:"checkbox",checked:D,onChange:ne=>M(ne.target.checked)}),t.jsxs("span",{children:[t.jsx("b",{children:"Write new tests."}),` The Builder writes tests for every "done when". Turn it off for a demo, a small text or colour change, or a project with no tests yet: squad-kit still runs your project's own checks, the review and the proof, and the story says "Built without new tests".`]})]})]})]})}const bz=60;function wz(e){const[n,s]=N.useState(Date.now());return N.useEffect(()=>{const r=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(r)},[e]),n}function Nz({job:e}){const n=wz(!0),s=Math.max(0,Math.floor((n-Date.parse(e.startedAt))/1e3)),i=["read","look","write"].indexOf(e.step),a=u=>u<i?"done":u===i?"now":"todo",l=e.looked.slice(-3),c=e.looked.length-l.length;return t.jsxs("div",{className:"drafting",role:"status","aria-live":"polite",children:[t.jsxs("div",{className:"drafting-head",children:[t.jsx("b",{children:"The Analyst is filling in your ticket"}),t.jsx("span",{className:"grow"}),t.jsxs("span",{className:"mono drafting-clock","aria-label":`${s} seconds so far`,children:[Math.floor(s/60),":",String(s%60).padStart(2,"0")]})]}),t.jsx(km,{state:a(0),children:"Read your message"}),t.jsxs(km,{state:a(1),children:["Looking at the project",l.length>0&&t.jsxs("span",{className:"note",children:[": ",l.join(", "),c>0?` and ${c} more`:""]})]}),t.jsx(km,{state:a(2),children:"Writing the ticket for you to check"}),t.jsxs("p",{className:"note",children:[s>2*bz?"This one is taking longer than usual. You can wait, or press Cancel.":"Usually under a minute."," You can close this window: the draft waits for you under New ticket."]})]})}function km({state:e,children:n}){return t.jsxs("div",{className:`dstep ${e}`,children:[t.jsx("span",{className:"dot","aria-hidden":"true",children:e==="done"?t.jsx(ce,{size:12,strokeWidth:3}):e==="now"?t.jsx(Xe,{size:12,className:"spin"}):null}),t.jsxs("span",{children:[n,t.jsx("span",{className:"sr-only",children:e==="done"?" (done)":e==="now"?" (now)":""})]})]})}function Sz({error:e,onRetry:n,onWrite:s}){return e?t.jsx(ug,{title:"The Analyst could not finish",what:e,safe:["Your text and files are kept.","No ticket was made yet."],ways:[{label:"Try again",primary:!0,icon:t.jsx(gi,{size:14}),onClick:n},{label:"Write it myself with what I typed",icon:t.jsx(tl,{size:14}),onClick:s}]}):t.jsxs("div",{className:"drafterr calm",role:"status",children:[t.jsx("b",{children:"You stopped the Analyst"}),t.jsx("div",{children:"Nothing was saved. Your text is kept."}),t.jsxs("div",{className:"drafterr-ways",children:[t.jsxs("button",{className:"btn pri",onClick:n,children:[t.jsx(gi,{size:14})," Try again"]}),t.jsxs("button",{className:"btn",onClick:s,children:[t.jsx(tl,{size:14})," Write it myself with what I typed"]})]})]})}const Cz=[{id:"full",name:"Full",note:"Every step. The Analyst asks questions and you approve the plan."},{id:"express",name:"Express",note:"For a typo or a small urgent fix. No questions, the plan is approved on its own. Build, checks, review and your Looks right still run."}];function rd({label:e,hint:n,items:s,onChange:r,add:i}){const a=(l,c)=>r(s.map((u,h)=>h===l?c:u));return t.jsxs("div",{className:"field",children:[t.jsx("label",{children:e}),s.length===0&&t.jsx("p",{className:"note",style:{margin:"0 0 6px"},children:n}),s.map((l,c)=>t.jsxs("div",{className:"listrow",children:[t.jsx("span",{className:"mono note",children:c+1}),t.jsx("input",{className:"input",dir:je(l),value:l,autoFocus:l===""&&c===s.length-1,onChange:u=>a(c,u.target.value),onKeyDown:u=>{u.key==="Enter"&&c===s.length-1&&l.trim()&&r([...s,""])},"aria-label":`${e} ${c+1}`}),t.jsx("button",{className:"iconbtn",onClick:()=>r(s.filter((u,h)=>h!==c)),"aria-label":`Remove ${e.toLowerCase()} ${c+1}`,children:t.jsx(Ue,{size:14})})]},c)),t.jsxs("button",{className:"btn sm",onClick:()=>r([...s,""]),children:[t.jsx(jt,{size:13})," ",i]})]})}const $z=/\.(ogg|opus|oga|m4a|mp3|wav|aac|amr|flac|weba|mp4|mov|m4v|webm)$/i;function vm({files:e,onAdd:n,onRemove:s}){const[r,i]=N.useState(!1),a=e.some(c=>$z.test(c.name)),l=ve({queryKey:["speech"],queryFn:()=>ye("/api/v1/speech"),enabled:a});return t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"Files"}),t.jsxs("label",{className:`dropzone ${r?"over":""}`,onDragOver:c=>{c.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:c=>{c.preventDefault(),i(!1),c.dataTransfer.files.length&&n(c.dataTransfer.files)},onPaste:c=>c.clipboardData.files.length&&n(c.clipboardData.files),children:[t.jsx(qd,{size:15})," Drop screenshots, documents, voice or video notes here, or click to pick",t.jsx("input",{type:"file",multiple:!0,hidden:!0,onChange:c=>{c.target.files?.length&&n(c.target.files),c.target.value=""}})]}),e.length>0&&t.jsx("div",{className:"picked",children:e.map((c,u)=>t.jsxs("span",{className:"pickedfile",children:[c.preview?t.jsx("img",{src:c.preview,alt:""}):t.jsx(qd,{size:13}),t.jsx("span",{className:"mono",children:c.name}),t.jsx("span",{className:"note",children:c.size<1024*1024?`${Math.max(1,Math.round(c.size/1024))} KB`:`${(c.size/1024/1024).toFixed(1)} MB`}),t.jsx("button",{className:"iconbtn",onClick:()=>s(u),"aria-label":`Remove ${c.name}`,children:t.jsx(Ue,{size:13})})]},`${c.name}-${u}`))}),a&&l.data&&t.jsx("p",{className:"note",style:{marginTop:6},children:l.data.hasKey?l.data.video===!1?"squad-kit writes out voice notes with Munsit, so every agent knows what was said. Video notes need a Mac: on this computer they stay attached, unheard.":"squad-kit writes out voice and video notes with Munsit, and takes pictures of the screen in videos, so every agent knows what was said.":"Add a Munsit key in Settings so the squad can listen to voice and video notes. Without it they stay attached, unheard."})]})}function Tz({onClose:e,onCreated:n}){const s=re(),r=ve({queryKey:["tracker"],queryFn:()=>ye("/api/v1/tracker")}).data,i=r?.example??"AB#40",[a,l]=N.useState(i.replace(/\d+$/,"")),c=a.replace(/\D/g,"").length===0||s.isPending,u=()=>{c||s.mutate({path:"/api/v1/pull",body:{ref:a}},{onSuccess:h=>(n(h),e())})};return t.jsxs(Ye,{title:`Pull from ${r?.label??"the tracker"}`,onClose:e,icon:t.jsx("span",{className:"glyph",children:t.jsx(gs,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:c,onClick:u,children:[t.jsx(gs,{size:15})," Pull ticket"]}),t.jsx("button",{className:"btn",onClick:e,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad pull ${Ci(a.trim()||i)}`})]}),children:[t.jsx("p",{children:"Bring an item in as a ticket, with its description and attachments."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"pull-ref",children:"Item"}),t.jsx("input",{id:"pull-ref",className:"input mono",autoFocus:!0,value:a,placeholder:i,onChange:h=>l(h.target.value),onKeyDown:h=>h.key==="Enter"&&u()})]})]})}const J3=[{value:"stops-work",label:"Stops work"},{value:"annoying",label:"Annoying"},{value:"small",label:"Small"}];function hg({onClose:e,foundIn:n}){const s=re(),[r,i,a]=$e("report-bug","what",""),[l,c,u]=$e("report-bug","how",""),[h,m,p]=$e("report-bug","expected",""),[x,g]=N.useState("annoying"),j=()=>{a(),u(),p()},k=()=>s.mutate({path:"/api/v1/bugs",body:{what:r,how:l,expected:h,severity:x,foundIn:n},done:"Bug reported. Triage is sorting it."},{onSuccess:()=>{j(),e()}});return t.jsxs(Ye,{title:"Report a bug",onClose:e,icon:t.jsx("span",{className:"glyph",style:{background:"var(--bug-soft)",color:"var(--bug)"},children:t.jsx(Js,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!r.trim()||s.isPending,onClick:k,children:[t.jsx(Js,{size:15})," Report bug"]}),t.jsx("button",{className:"btn",onClick:e,children:"Cancel"}),(r||l||h)&&t.jsx(xb,{onClear:j}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad bug ${Me(r.trim()||"What happened")}${n?` --in ${n}`:""}`})]}),children:[t.jsxs("p",{children:["It becomes a ticket linked to ",n??"the latest release",", and goes around the same loop. The Tester adds a check so it can't come back."]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"bug-what",children:"What happened?"}),t.jsx("input",{id:"bug-what",className:"input",autoFocus:!0,dir:je(r),value:r,onChange:b=>i(b.target.value),placeholder:"For example: Table text is hard to read in dark mode"})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"bug-how",children:"How can we see it?"}),t.jsx("input",{id:"bug-how",className:"input",dir:je(l),value:l,onChange:b=>c(b.target.value),placeholder:"The steps, in a line"})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"bug-exp",children:"What did you expect?"}),t.jsx("input",{id:"bug-exp",className:"input",dir:je(h),value:h,onChange:b=>m(b.target.value)})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"How bad is it?"}),t.jsx("div",{className:"sevs",children:J3.map(b=>t.jsxs("button",{className:`choice ${x===b.value?"on":""}`,onClick:()=>g(b.value),children:[t.jsx("span",{className:"rd"}),b.label]},b.value))})]})]})}function Ez({release:e,demo:n,onClose:s}){const{toast:r}=Le(),i=()=>void navigator.clipboard?.writeText(e.whatsappDraft??"").then(()=>r("Message copied. Send it from WhatsApp.")),a=[e.addons.changelog&&"Changelog updated",e.addons.tag&&`Marked the code as ${e.version}`,e.addons.pipeline&&"After-release step started"].filter(Boolean);return t.jsxs(Ye,{title:e.unpushed?.length?`${e.version} is made, but not sent yet`:`${e.version} is released`,onClose:s,icon:t.jsx("span",{className:"glyph",children:t.jsx(Fo,{size:15})}),footer:t.jsxs(t.Fragment,{children:[e.addons.whatsapp&&t.jsxs("button",{className:"btn pri",onClick:i,children:[t.jsx(Mn,{size:15})," Copy message"]}),t.jsx("button",{className:"btn",onClick:s,children:"Done"})]}),children:[t.jsxs("div",{className:"donelist",children:[e.unpushed?.length?t.jsxs("div",{style:{color:"var(--you-ink)"},children:[t.jsx("span",{style:{width:16,textAlign:"center",fontWeight:800},children:"!"})," It did not reach your team's shared copy of the code, so its tickets stay open. Press Send again on the release once it can."]}):t.jsxs("div",{children:[t.jsx(ce,{size:16})," ",e.tickets.length," tickets released"]}),e.log?e.log.map(l=>t.jsxs("div",{style:l.ok?void 0:{color:"var(--you-ink)"},...ze(l.text),children:[l.ok?t.jsx(ce,{size:16}):t.jsx("span",{style:{width:16,textAlign:"center",fontWeight:800},children:"!"})," ",t.jsx(R,{text:l.text})]},l.text)):a.map(l=>t.jsxs("div",{children:[t.jsx(ce,{size:16})," ",l]},l))]}),n&&!e.log&&t.jsx("p",{className:"note",style:{marginBottom:12},children:"Demo board: these release steps are shown, not run."}),e.addons.whatsapp&&e.whatsappDraft&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",style:{marginTop:4},children:"A WhatsApp note for your manager. Copy it and send it yourself."}),t.jsx(f1,{className:"wa",text:e.whatsappDraft})]})]})}const sk=10*1024*1024;function Az({t:e,size:n,text:s,setText:r,input:i,onSent:a,sendRef:l,setPending:c,box:u,onBoxCancel:h}){const m=re(),{toast:p}=Le(),x=e.chat,g=ct[x.with],[j,k]=N.useState([]),[b,w]=N.useState(!1),S=N.useRef(null),T=tt(s),E=ES(T),z=Math.min(6,Math.max(1,s.split(`
709
+ `).length)),$=async D=>{const M=[...D],Y=M.find(H=>H.size>sk);Y&&p(`${Y.name} is larger than 10 MB.`,"err");const ae=await Promise.all(M.filter(H=>H.size<=sk).slice(0,10).map(zl)).catch(H=>(p(H.message,"err"),[]));k(H=>[...H,...ae].slice(0,10))},[P,L]=N.useState(!1),W=()=>{L(!0),setTimeout(()=>L(!1),220)},F=(D=s,M=[])=>{if(u){if(!D.trim())return;W(),u.send(D.trim()),r("");return}const Y=[...j,...M];if(!D.trim()&&!Y.length||x.thinking||m.isPending)return;c({text:D,files:Y,count:x.messages.length}),W();const ae=s;r(""),k([]),a(),m.mutate({path:`/api/v1/tickets/${e.id}/chat/send`,body:{text:D,files:Y.map(({name:H,data:Z})=>({name:H,data:Z}))}},{onError:()=>{c(null),r(ae),k(Y.filter(H=>!M.includes(H)))}})};l.current=D=>F(D);const U=()=>m.mutate({path:`/api/v1/tickets/${e.id}/chat/stop`}),I=u?u.placeholder:n==="phone"?`Message the ${g}`:n==="pop"?`Answer the ${g}, or ask it something…`:`Message the ${g} in Arabic or English`;return t.jsxs("div",{className:"ccomp",onDragOver:D=>(D.preventDefault(),w(!0)),onDragLeave:()=>w(!1),onDrop:D=>(D.preventDefault(),w(!1),void $(D.dataTransfer.files)),children:[b&&t.jsx("div",{className:"cdrop",children:"Drop files to add them to your message"}),u&&t.jsx(T1,{box:u,onCancel:()=>h?.()}),t.jsx(Pz,{who:g,size:n,onDone:D=>F(s,[D]),render:D=>D.on?D.box:t.jsxs("div",{className:`cbox ${n==="phone"?"m":""} ${u?"asking":""}`,children:[j.length>0&&t.jsx("div",{className:"cpicked",children:j.map((M,Y)=>t.jsxs("span",{className:"chip",children:[M.preview?t.jsx("img",{src:M.preview,alt:""}):t.jsx(qd,{size:12})," ",M.name,t.jsx("button",{className:"iconbtn","aria-label":`Remove ${M.name}`,onClick:()=>k(j.filter((ae,H)=>H!==Y)),children:t.jsx(Ue,{size:11})})]},Y))}),n==="phone"&&t.jsx("button",{className:"ib","aria-label":"Add screenshots or files",onClick:()=>S.current?.click(),children:t.jsx(jt,{size:20})}),t.jsx("textarea",{ref:i,className:`cta ${s?Fs(T):"t-en"}`,dir:s?T.dir:"auto",lang:T.dir==="rtl"?"ar":"en",rows:z,value:s,placeholder:I,"aria-label":"Your message",onChange:M=>r(M.target.value),onPaste:M=>{const Y=[...M.clipboardData.files];Y.length&&$(Y)},onKeyDown:M=>{M.key==="Enter"&&!M.shiftKey&&!M.nativeEvent.isComposing&&(M.preventDefault(),F())}}),n==="phone"?x.thinking?t.jsx("button",{className:"csend m stop",onClick:U,"aria-label":"Stop the answer",children:t.jsx(Jn,{size:14,fill:"currentColor"})}):s.trim()||j.length?t.jsx("button",{className:`csend m ${P?"go":""}`,onClick:()=>F(),"aria-label":"Send",disabled:m.isPending,children:t.jsx(Zn,{size:18})}):t.jsx("button",{className:"csend m mic",onClick:D.start,"aria-label":"Record a voice note",children:t.jsx($j,{size:18})}):t.jsxs("div",{className:"crow",children:[t.jsx("button",{className:"ib","aria-label":"Add screenshots or files",title:"Add screenshots or files",onClick:()=>S.current?.click(),children:t.jsx(qd,{size:16})}),t.jsx("button",{className:"ib","aria-label":"Record a voice note",title:"Record a voice note",onClick:D.start,children:t.jsx($j,{size:16})}),E&&t.jsx("span",{className:"clchip",children:E}),t.jsx("span",{className:"grow"}),x.thinking?t.jsxs("button",{className:"cstop",onClick:U,disabled:x.stopping||m.isPending,children:[t.jsx(Jn,{size:11,fill:"currentColor"})," ",x.stopping?"Stopping…":"Stop"]}):t.jsx("button",{className:`csend ${P?"go":""}`,onClick:()=>F(),disabled:m.isPending||!s.trim()&&!j.length,"aria-label":"Send",children:t.jsx(Zn,{size:17})})]}),t.jsx("input",{ref:S,type:"file",multiple:!0,hidden:!0,onChange:M=>M.target.files&&void $(M.target.files)})]})}),n==="pop"?t.jsxs("div",{className:"where",children:[t.jsxs("span",{className:"chip",children:[t.jsx(Pa,{size:12,"aria-hidden":"true"}),e.id]}),t.jsx("span",{children:"Enter to send"})]}):n!=="phone"&&t.jsx("div",{className:"chint",children:"Enter sends · Shift+Enter for a new line · It answers in the language you write"})]})}function Pz({who:e,size:n,onDone:s,render:r}){const{toast:i}=Le(),[a,l]=N.useState(!1),[c,u]=N.useState(0),h=N.useRef(null),m=N.useRef(!1);N.useEffect(()=>{if(!a)return;const j=setInterval(()=>u(k=>k+1),1e3);return()=>clearInterval(j)},[a]),N.useEffect(()=>()=>h.current?.stream.getTracks().forEach(j=>j.stop()),[]);const p=async()=>{try{const j=await navigator.mediaDevices.getUserMedia({audio:!0}),k=["audio/webm","audio/ogg","audio/mp4"].find(S=>MediaRecorder.isTypeSupported?.(S))??"",b=new MediaRecorder(j,k?{mimeType:k}:void 0),w=[];b.ondataavailable=S=>S.data.size&&w.push(S.data),b.onstop=()=>{if(j.getTracks().forEach($=>$.stop()),!m.current||!w.length)return;const S=b.mimeType||k||"audio/webm",T=S.includes("ogg")?"ogg":S.includes("mp4")?"m4a":"weba",E=new Date().toTimeString().slice(0,8).replace(/:/g,""),z=new File(w,`voice-note-${E}.${T}`,{type:S});zl(z).then(s)},h.current=b,m.current=!1,u(0),b.start(),l(!0)}catch{i("The microphone is not available. Allow it for this page, or attach a voice note file.","err")}},x=j=>{m.current=j,h.current?.stop(),l(!1)},g=t.jsxs("div",{className:`crec ${n==="phone"?"m":""}`,role:"group","aria-label":"Recording a voice note",children:[t.jsx("span",{className:"crdot"}),t.jsxs("span",{className:"crt",children:["0:",String(c).padStart(2,"0")," · Recording for the ",e]}),t.jsx("span",{className:"clw","aria-hidden":"true",children:Array.from({length:22},(j,k)=>t.jsx("i",{style:{animationDelay:`${k%7*.11}s`}},k))}),t.jsx("button",{className:"btn sm",onClick:()=>x(!1),children:"Cancel"}),t.jsx("button",{className:"btn sm pri",onClick:()=>x(!0),children:"Send"})]});return t.jsx(t.Fragment,{children:r({on:a,start:()=>void p(),box:g})})}function zu({id:e,size:n,onOpenDoc:s,onFull:r,onPanel:i}){const a=qa(e),l=a.data,c=l?.chat,u=Ia(Al),[h,m]=$e(e,"chat",""),p=N.useRef(null),x=N.useRef(null),[g,j]=N.useState(null),{box:k,cancel:b,door:w}=aw(()=>setTimeout(()=>p.current?.focus(),0)),S=l?.chat?.messages.length??0;N.useEffect(()=>{g&&S>g.count&&j(null)},[S,g]);const T=c?c.beside?"chat":s2[c.with]:"",E=ve({queryKey:["conversation",e,T],queryFn:()=>ye(`/api/v1/tickets/${e}/conversations/${T}`),enabled:!!(c&&(c.beside?c.side:l?.sessions?.[s2[c.with]])),refetchInterval:c?.thinking?1500:8e3,retry:!1}),z=N.useMemo(()=>Cw(E.data?.updates??[]).filter(pe=>pe.kind==="tool"),[E.data]),$=(pe,xe)=>z.filter(Te=>(!pe||(Te.at??"")>=pe)&&(!xe||(Te.at??"")<=xe)),P=N.useMemo(()=>c?.messages??[],[c?.messages]),{writing:L,fresh:W,drafted:F}=E$(P,!!c,u),U=C1(e,P.length),[I]=N.useState(()=>Nt.get().seen[e]),D=I!==void 0&&I<P.length&&P.slice(I).some(df)?I:-1;if(N.useEffect(()=>{c&&Nt.seen(e,P.length)},[c,e,P.length]),!l)return t.jsx("div",{className:"cempty",children:a.isError?`No ticket ${e}.`:"Loading…"});const Y=w1(l)!==null||$$(l.id)?t.jsx(Sw,{story:l.id},l.id):null;if(!c)return t.jsx(Dd.Provider,{value:w,children:t.jsxs("div",{className:`chat-v csize-${n}`,children:[t.jsx("div",{className:"cthread",ref:U.boxRef,children:t.jsxs("div",{className:"ccol",ref:U.contentRef,children:[t.jsx(Jj,{t:l}),Y,t.jsxs("div",{className:"cempty inline",children:[t.jsxs("p",{children:["No talk on ",l.id," yet."]}),t.jsx(Ai,{t:l,agent:N1(l),primary:!0,small:!0})]})]})}),k&&t.jsx(Hj,{t:l,box:k,onCancel:b})]})});const ae=ct[c.with],H=Ew(l),Z=[...P].reverse().find(pe=>pe.who==="you"),ue=Aw(l),q=KT(l),B=H.kind==="working"?`You are asking the ${ae}. ${q?`The ${ct[q]}`:"The squad"} keeps working on ${l.id}, and this talk changes nothing.`:H.kind==="review"||H.kind==="still"?`You are asking the ${ae} about ${l.id}. It stays where it is, and this talk changes nothing.`:H.kind==="released"?`${l.id} is ${l.stage==="done"?"released":"accepted"}. Ask the ${ae} anything about it.`:`You started talking with the ${ae}. Its work on ${l.id} waits until you press ${ue?ue.label:"Done"}${ue&&ue.label!=="Back to work"?" or Done":""}.`,ee=[...P].reverse().find(df),O=pe=>{pe!==void 0&&m(pe),setTimeout(()=>p.current?.focus(),0)},ke=c.thinking&&c.draft&&P.at(-1)?.note!=="waits"?c.draft:"";return t.jsx(Dd.Provider,{value:w,children:t.jsxs("div",{className:`chat-v csize-${n}`,children:[t.jsx(VT,{t:l,size:n,onFull:r,onPanel:i}),t.jsxs("div",{className:"cthread",ref:U.boxRef,"aria-live":"polite",children:[t.jsxs("div",{className:"ccol",ref:U.contentRef,children:[c.open&&n!=="pop"&&t.jsx("div",{className:"cnote-pill",children:B}),P.map((pe,xe)=>{const Te=xe===D?t.jsx(R$,{}):null;if(pe.who==="squad")return t.jsxs(N.Fragment,{children:[Te,t.jsx(HL,{t:l,m:pe,last:xe===P.length-1,onAsk:()=>O()})]},xe);if(pe.who==="you")return t.jsxs(N.Fragment,{children:[Te,t.jsx(OL,{t:l,m:pe,fresh:W(pe),onOpenDoc:s,onReply:pt=>O(pt)})]},xe);const Ee=P[xe-1],Fe=L?.key===Lo(pe),Ge=P[xe+1];return t.jsxs(N.Fragment,{children:[Te,t.jsx(_L,{t:l,m:pe,size:n,used:$(Ee?.at,pe.at),writing:Fe?L.shown:null,answer:Ge?.who==="you"?Ge.text:void 0,canChoose:c.open&&!c.thinking&&pe===ee&&xe===P.length-1,newest:pe===ee,onChoose:pt=>x.current?.(pt),onOther:()=>O(),onOpenDoc:s,onReply:pt=>O(pt)})]},xe)}),g&&t.jsx(qL,{p:g}),ke?t.jsx(RL,{t:l,role:c.with,text:ke,size:n,onShown:pe=>F.current={text:ke,shown:pe}}):c.thinking&&P.at(-1)?.note!=="waits"&&t.jsx(UL,{role:c.with,steps:$(Z?.at??P.at(-1)?.at),hasMessage:!!Z}),t.jsx(Jj,{t:l}),Y]}),t.jsx($1,{s:U})]}),c.open?t.jsx(Az,{t:l,size:n,text:h,setText:m,input:p,onSent:()=>U.toBottom(),sendRef:x,setPending:j,box:k,onBoxCancel:b}):k?t.jsx(Hj,{t:l,box:k,onCancel:b}):t.jsx("div",{className:"cclosed",children:"This talk is over. It stays here to read."})]})})}function e4(e=3e3){return ve({queryKey:["requirements"],queryFn:()=>ye("/api/v1/requirements"),refetchInterval:e})}function Rz(e){return e?$i(e.state.job)||!!e.state.build?.on||e.state.sync?.status==="running"||e.state.sync?.status==="pending"||e.counts.building>0||e.questions.some(n=>n.thinking):!1}function qz(e){return ve({queryKey:["requirement",e],queryFn:()=>ye(`/api/v1/requirements/${encodeURIComponent(e)}`),refetchInterval:n=>n.state.status==="error"?1e4:Rz(n.state.data)?1e3:4e3,retry:!1})}function Iz(e,n){return ve({queryKey:["requirement-send",e],queryFn:()=>ye(`/api/v1/requirements/${encodeURIComponent(e)}/send`),enabled:n,retry:!1,staleTime:0})}function t4(e){if(!e||typeof e!="object")return null;const n=e;return Array.isArray(n.epics)&&typeof n.id=="string"?n:n.breakdown?t4(n.breakdown):null}function Rt(){const e=Ot(),{toast:n}=Le(),s=yl({mutationFn:({path:r,body:i,method:a="POST"})=>et(r,a,i??{}),onSuccess:(r,i)=>{const a=t4(r);a&&e.setQueryData(["requirement",a.id],a),e.invalidateQueries({queryKey:["requirements"]}),e.invalidateQueries({queryKey:["board"]}),i.done&&n(i.done)},onError:(r,i)=>{i.quiet||n(n4(r),"err",Ov(r)?()=>s.mutate(i):void 0)}});return s}function n4(e){return e instanceof uu&&e.status===404&&/^404\b/.test(e.message)?"This squad-kit cannot do that yet. Update squad-kit, then try again.":e instanceof Error?e.message:String(e)}function Xd(e,n){const s=Ea()??"";return`${vl(`/api/v1/requirements/${encodeURIComponent(e)}/file`)}?path=${encodeURIComponent(n)}&t=${encodeURIComponent(s)}`}const s4=e=>`squad.send-plan.${gt??""}.${e}`;function rk(e,n){try{sessionStorage.setItem(s4(e),JSON.stringify(n))}catch{}}function r4(e){try{const n=sessionStorage.getItem(s4(e)),s=n?JSON.parse(n):null;return s&&typeof s.items=="number"&&typeof s.links=="number"?s:null}catch{return null}}const Mu=e=>`/api/v1/requirements/${encodeURIComponent(e)}`,Ef=10*1024*1024,Fz=10;function Na(e){const n=e instanceof Error?e.message:String(e),s=/^(\d{3}) [^:]*: ?([\s\S]*)$/.exec(n);if(!s)return n4(e);try{const r=JSON.parse(s[2]);if(r.error&&r.error!=="not found")return r.error}catch{}return s[1]==="404"?"This squad-kit cannot do that yet. Update squad-kit, then try again.":s[2]?.trim()||n}function i4(e){const n=/\.([a-z0-9]+)$/i.exec(e)?.[1]?.toLowerCase();return n==="pdf"?"pdf":n==="docx"?"docx":n==="md"||n==="markdown"?"markdown":n==="txt"||n==="text"?"text":null}const Lz={pdf:"PDF",docx:"DOCX",markdown:"MD",text:"TXT"},zz={pdf:"PDF",docx:"Word document",markdown:"Markdown",text:"Text"};function Mz(e){return e<1024?`${e} bytes`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`}const Af=e=>e.replace(/\.[^.]+$/,"");async function a4(e){if(!i4(e.name))throw new Error(`${e.name}: squad-kit reads PDF, Word (.docx), Markdown and text files. Save the BRD as one of those, or paste the text.`);if(e.size>Ef)throw new Error(`${e.name} is larger than 10 MB.`);return zl(e)}function o4({file:e,onPick:n,onClear:s,hint:r}){const[i,a]=N.useState(!1),l=e?i4(e.name):null;return t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:`rq-drop ${i?"over":""}`,onDragOver:c=>{c.preventDefault(),a(!0)},onDragLeave:()=>a(!1),onDrop:c=>{c.preventDefault(),a(!1),n(c.dataTransfer.files)},children:[t.jsx("input",{type:"file",className:"sr-only",accept:".pdf,.docx,.md,.markdown,.txt",onChange:c=>n(c.target.files)}),t.jsx(kS,{size:24,"aria-hidden":"true"}),t.jsxs("b",{children:["Drop your BRD here, or ",t.jsx("u",{children:"choose a file"})]}),t.jsx("span",{children:r??"PDF, Word, Markdown or text, up to 10 MB"})]}),e&&l&&t.jsxs("div",{className:"rq-file",children:[t.jsx("span",{className:`rq-ftag ${l}`,children:Lz[l]}),t.jsxs("div",{className:"grow",children:[t.jsx("b",{children:e.name}),t.jsxs("span",{children:[Mz(e.size),", ",zz[l]]})]}),t.jsx("button",{className:"iconbtn","aria-label":"Remove the file",onClick:s,children:t.jsx(Ue,{size:14})})]})]})}function Oz({onClose:e}){const n=Rt(),s=_t(),[r,i]=N.useState(null),[a,l,c]=$e("add-brd","paste",!1),[u,h,m]=$e("add-brd","text",""),[p,x,g]=$e("add-brd","name",""),[j,k]=N.useState(!1),[b,w]=N.useState([]),[S,T]=N.useState(null),E=N.useRef(null),z=async F=>{const U=F?[...F][0]:void 0;if(U){T(null);try{const I=await a4(U);i(I),l(!1),j||x(Af(U.name))}catch(I){T(I.message)}}},$=async F=>{const U=[...F??[]],I=U.find(M=>M.size>Ef);I&&T(`${I.name} is larger than 10 MB.`);const D=await Promise.all(U.filter(M=>M.size<=Ef).map(zl)).catch(M=>(T(M.message),[]));w(M=>[...M,...D].slice(0,Fz-1))},P=a?!!u.trim():!!r,L=a?`squad requirements add --paste${p.trim()?` --name ${Me(p.trim())}`:""}`:`squad requirements add ${r?Me(r.name):"<file>"}${r&&p.trim()&&p.trim()!==Af(r.name)?` --name ${Me(p.trim())}`:""}${b.map(F=>` --with ${Me(F.name)}`).join("")}`,W=()=>{if(!P)return;T(null);const F=a?{text:u,...p.trim()?{name:p.trim()}:{},with:b.map(({name:U,data:I})=>({name:U,data:I}))}:{file:{name:r.name,data:r.data},...p.trim()?{name:p.trim()}:{},with:b.map(({name:U,data:I})=>({name:U,data:I}))};n.mutate({path:"/api/v1/requirements",body:F},{onSuccess:U=>{c(),m(),g(),e(),s({to:"/requirements/$id",params:{id:U.id}})},onError:U=>T(Na(U))})};return t.jsxs(Ye,{title:"Add a BRD",onClose:e,losing:r||b.length?r?`the file ${r.name}`:"the attached files":null,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-fcmd",children:t.jsx(X,{text:L})}),t.jsx("button",{className:"btn",onClick:e,children:"Cancel"}),t.jsxs("button",{className:"btn pri",disabled:!P||n.isPending,onClick:W,children:[n.isPending&&t.jsx(Xe,{size:14,className:"spin"})," Break it down"]})]}),children:[t.jsx("p",{children:"The Analyst breaks it into epics, features and stories. Nothing is built or sent anywhere until you approve."}),t.jsxs("div",{className:"rq-add",children:[a?t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-paste",children:"The BRD's text"}),t.jsx("textarea",{id:"rq-paste",className:"textarea rq-pastebox",autoFocus:!0,dir:je(u),value:u,onChange:F=>h(F.target.value),placeholder:"Paste the whole document here. Headings help the Analyst find its parts."}),t.jsxs("div",{className:"rq-hint",children:["Have the file?"," ",t.jsx("button",{className:"rq-link",onClick:()=>l(!1),children:"Choose a file instead"})]})]}):t.jsxs(t.Fragment,{children:[t.jsx(o4,{file:r,onPick:F=>void z(F),onClear:()=>i(null)}),t.jsxs("div",{className:"rq-hint",children:["No file?"," ",t.jsx("button",{className:"rq-link",onClick:()=>l(!0),children:"Paste the text instead"})]})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-name",children:"Name"}),t.jsx("input",{id:"rq-name",className:"input",dir:je(p),value:p,placeholder:a?"Named after its first heading":"Named after the file",onChange:F=>{x(F.target.value),k(!0)}})]}),t.jsxs("div",{className:"rq-hint",children:["Screen mockups or other files that go with it?"," ",t.jsx("button",{className:"rq-link",onClick:()=>E.current?.click(),children:"Add them"}),t.jsx("input",{ref:E,type:"file",multiple:!0,className:"sr-only",tabIndex:-1,"aria-hidden":"true",onChange:F=>void $(F.target.files)})]}),b.length>0&&t.jsx("div",{className:"rq-extras",children:b.map((F,U)=>t.jsxs("span",{className:"rq-extra",children:[t.jsx(rS,{size:13,"aria-hidden":"true"}),F.name,t.jsx("button",{"aria-label":`Remove ${F.name}`,onClick:()=>w(I=>I.filter((D,M)=>M!==U)),children:t.jsx(Ue,{size:12})})]},`${F.name}-${U}`))}),S&&t.jsx("p",{className:"rq-err",role:"alert",children:S}),t.jsxs("div",{className:"rq-next",children:[t.jsx("div",{className:"rq-next-h",children:"What happens next"}),t.jsxs("div",{className:"rq-nstep",children:[t.jsx("span",{children:"1"}),"The Analyst reads it and asks you only about parts that are missing or that clash."]}),t.jsxs("div",{className:"rq-nstep",children:[t.jsx("span",{children:"2"}),"You edit the breakdown and approve it."]}),t.jsxs("div",{className:"rq-nstep",children:[t.jsx("span",{children:"3"}),"Send it to your tracker, let the squad build it story by story, or both."]})]})]})]})}function _z({v:e,onClose:n}){const s=Rt(),r=Iz(e.id,!0),[i,a]=N.useState(!1),[l,c]=N.useState(null),[u,h]=N.useState(null),m=e.tracker?.label??"the tracker",p=e.state.sync,x=i&&!l&&(s.isPending||!p||p.status==="running"||p.status==="pending"),g=i&&p?.status==="done"&&!s.isPending,j=i&&p?.status==="failed"||!!l,k=r.data,b=JC(e),w=s.isPending?nf(void 0):nf(p,u??r4(e.id)),S=Ub(w),T=async()=>{c(null),a(!0);const $=j?(await r.refetch()).data??k:k,P=$?{items:$.items,links:$.first?$.counts.links:$.links}:null;h(P),P&&rk(e.id,P),s.mutate({path:`${Mu(e.id)}/send`,quiet:!0},{onSuccess:L=>P&&L?.state?.sync?.at&&rk(e.id,{...P,at:L.state.sync.at}),onError:L=>c(Na(L))})},E=k?.tracker.project??e.tracker?.project,z=k&&k.items===0&&k.links===0;return t.jsxs(Ye,{title:`Send to ${m}`,onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-fcmd",children:t.jsx(X,{text:`squad requirements send ${e.id}`})}),x||g?t.jsx("button",{className:"btn",onClick:n,children:"Close"}):t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),j?t.jsxs("button",{className:"btn pri",onClick:()=>void T(),disabled:s.isPending,children:[t.jsx(gi,{size:14})," Send again"]}):t.jsx("button",{className:"btn pri",onClick:()=>void T(),disabled:!k||!!z||s.isPending,children:k?k.first?`Send ${k.items} items`:"Send changes":"Send"})]})]}),children:[t.jsxs("p",{children:["Into ",E?t.jsxs(t.Fragment,{children:["project ",t.jsx("b",{className:"rq-ink",children:E})]}):`your ${m} project`,", as the item types it uses. They go into the backlog, not a sprint."]}),r.isLoading?t.jsx("p",{className:"note",children:"Working out what to send…"}):r.isError?t.jsxs("div",{className:"rq-err",role:"alert",children:["squad-kit could not work out what to send. ",Na(r.error)," ",t.jsx("button",{className:"rq-link",onClick:()=>void r.refetch(),children:"Try again"})]}):k?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"rq-send",children:[t.jsxs("div",{className:"rq-li",children:[t.jsx("b",{children:k.counts.epics.all}),Gp(k.levels.epic),t.jsx("span",{children:Qp(k.counts.epics,k.first)})]}),k.counts.features.all>0&&t.jsxs("div",{className:"rq-li",children:[t.jsx("b",{children:k.counts.features.all}),Gp(k.levels.feature),", each under its epic",t.jsx("span",{children:Qp(k.counts.features,k.first)})]}),t.jsxs("div",{className:"rq-li",children:[t.jsx("b",{children:k.counts.stories.all}),Gp(k.levels.story),", each under its ",k.counts.storiesUnderEpic?k.counts.features.all?"feature or epic":"epic":"feature",t.jsx("span",{children:k.first?'with "done when" as acceptance criteria':Qp(k.counts.stories,!1)})]}),(k.first?k.counts.links:k.links)>0&&t.jsxs("div",{className:"rq-li",children:[t.jsx("b",{children:k.first?k.counts.links:k.links}),k.first?"Links between stories that need each other":"New links between stories that need each other",b&&t.jsx(R,{text:`"${b}"`})]})]}),z&&t.jsx("p",{className:"note",children:"Everything is sent already. Edit the breakdown and Send changes updates the same items."})]}):null,t.jsxs("div",{className:"rq-promise",children:[t.jsx("div",{children:"Each story's number shows in the breakdown. When the squad builds a story, its item moves forward and gets the squad's notes, as tickets from the Backlog do today."}),t.jsxs("div",{children:["Edit the breakdown later and ",t.jsx("b",{children:"Send changes"})," updates the same items. squad-kit never deletes anything in ",m,"."]})]}),i&&(x||g||j)&&t.jsx("div",{className:`rq-sendprog ${j?"fail":""}`,role:"status",children:j?t.jsxs("span",{children:[t.jsx("b",{children:"The send stopped."})," ",l??p?.error??"Something went wrong on the way."," What was sent stays sent; Send again carries on without doubles."]}):g?t.jsxs("span",{children:[t.jsx("b",{children:"Sent."})," Each item's number shows in the breakdown now."]}):t.jsxs(t.Fragment,{children:[t.jsxs("span",{children:[w.phase==="links"?`${S.charAt(0).toUpperCase()}${S.slice(1)}`:`Sending${S?` ${S}`:""}`,"… You can close this: it carries on."]}),t.jsx("span",{className:"rq-pbar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":w.pct,"aria-label":"Sent so far",children:t.jsx("i",{style:{width:`${w.pct||5}%`}})})]})})]})}function Dz({v:e,item:n,text:s,onClose:r}){const i=Rt(),[a,l]=N.useState(s??""),c=n===e.id,u=c?null:ts(e,n),h=e.status==="approved"&&El(e).some(({story:p})=>p.ticket),m=()=>i.mutate({path:`${Mu(e.id)}/items/${encodeURIComponent(n)}/redo`,body:{ask:a.trim()},done:`The Analyst is redoing ${c?"the breakdown":n}.`},{onSuccess:r});return t.jsxs(Ye,{title:c?"Ask the Analyst":`Ask the Analyst to redo ${n}`,onClose:r,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-fcmd",children:t.jsx(X,{text:`squad requirements redo ${e.id} ${n} ${Me(a.trim()||"what to change")}`})}),t.jsx("button",{className:"btn",onClick:r,children:"Cancel"}),t.jsx("button",{className:"btn pri",disabled:!a.trim()||i.isPending,onClick:m,children:"Ask the Analyst"})]}),children:[t.jsx(R,{as:"p",text:`${c?"Say what to change in the breakdown, or what to add. The Analyst rewrites it and keeps the keys of what stays.":`Say what to change in ${n} ${u?.item.title??""}. The Analyst rewrites it and keeps its key.`}${h?" Stories that started stay as they are.":""}`}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-ask",children:"What should change"}),t.jsx("textarea",{id:"rq-ask",className:"textarea",autoFocus:!0,dir:je(a),value:a,onChange:p=>l(p.target.value),placeholder:c?"Add a story for staff to export bookings, under Admin and reports.":"Split it in two: one for holding the slot, one for freeing it."})]})]})}function Bz({v:e,level:n,under:s,onClose:r,onAdded:i}){const a=Rt(),l=N.useMemo(()=>n==="feature"?e.epics.map(S=>({key:S.key,label:`${S.key} ${S.title}`})):n==="story"?e.epics.flatMap(S=>[...S.features.map(T=>({key:T.key,label:`${S.title} › ${T.title}`})),{key:S.key,label:`${S.title}, straight under the epic`}]):[],[e.epics,n]),[c,u]=N.useState(s&&l.some(S=>S.key===s)?s:l.at(n==="story"?0:-1)?.key??""),[h,m,p]=$e(e.id,`add-${n}-title`,""),[x,g,j]=$e(e.id,`add-${n}-about`,""),k=n==="epic"?"an epic":`a ${n}`,b=!h.trim()||n!=="epic"&&!c||a.isPending,w=()=>{b||a.mutate({path:`${Mu(e.id)}/items`,body:{title:h.trim(),...n!=="epic"?{under:c,level:n}:{},...x.trim()?n==="epic"?{goal:x.trim()}:n==="feature"?{summary:x.trim()}:{story:x.trim()}:{}}},{onSuccess:S=>{p(),j(),i(S.key),r()}})};return t.jsxs(Ye,{title:`Add ${k}`,onClose:r,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-fcmd",children:t.jsx(X,{text:`squad requirements add-item ${e.id}${n!=="epic"?` --under ${c}`:""}${n==="feature"?" --feature":""} --title ${Me(h.trim()||"…")}`})}),t.jsx("button",{className:"btn",onClick:r,children:"Cancel"}),t.jsxs("button",{className:"btn pri",disabled:b,onClick:w,children:["Add ",k]})]}),children:[n!=="epic"&&t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-under",children:"Under"}),t.jsx("select",{id:"rq-under",className:"select",value:c,onChange:S=>u(S.target.value),children:l.map(S=>t.jsx("option",{value:S.key,children:es(S.label)},S.key))})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-title",children:"Title"}),t.jsx("input",{id:"rq-title",className:"input",autoFocus:!0,dir:je(h),value:h,onChange:S=>m(S.target.value),onKeyDown:S=>S.key==="Enter"&&w()})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-about",children:n==="epic"?"What it is for":n==="feature"?"What it covers":"Story"}),t.jsx("textarea",{id:"rq-about",className:"textarea",dir:je(x),value:x,onChange:S=>g(S.target.value),placeholder:n==="story"?"As a …, I want …, so that …":"One or two sentences"})]}),n==="story"&&t.jsx("p",{className:"note",children:'Add its "done when" checks on its panel before you approve.'})]})}function Wz({v:e,onClose:n,onOpenRef:s,onAsk:r}){return t.jsxs(Ye,{title:`${e.leftOut.length} ${e.leftOut.length===1?"part":"parts"} left out`,onClose:n,children:[t.jsx("p",{children:"Parts of the BRD the breakdown leaves out on purpose, and why. Ask the Analyst to add one if it should be built."}),t.jsx("div",{className:"rq-leftout",children:e.leftOut.map((i,a)=>t.jsxs("div",{className:"rq-lo",children:[t.jsx(R,{as:"b",text:i.text}),t.jsx(R,{text:i.why}),t.jsxs("div",{className:"rq-lo-acts",children:[i.ref&&t.jsx("button",{className:"rq-link",onClick:()=>s(i.ref),children:t.jsx(R,{text:Tl(i.ref)})}),r&&t.jsxs("button",{className:"btn sm",onClick:()=>r(Dj(i)),title:`squad requirements redo ${e.id} ${e.id} ${Me(Dj(i))}`,children:[t.jsx(Xn,{size:13})," Ask the Analyst to add it"]})]})]},a))})]})}function ik({items:e,ok:n}){return t.jsx("ul",{className:"rmlist",children:e.map(s=>t.jsxs("li",{children:[n?t.jsx(ce,{size:16,className:"ok","aria-hidden":!0}):t.jsx(Ue,{size:16,className:"x","aria-hidden":!0}),t.jsx("span",{children:s})]},s))})}function l4({id:e,title:n,sentTo:s,onClose:r,onDeleted:i}){const a=Rt(),[l,c]=N.useState(null),u=()=>a.mutate({path:Mu(e),method:"DELETE",quiet:!0,done:`Deleted ${e}.`},{onSuccess:()=>{r(),i?.()},onError:h=>c(Na(h))});return t.jsxs(Ye,{title:`Delete ${e}?`,icon:t.jsx("span",{className:"glyph",children:t.jsx(zn,{size:15})}),onClose:r,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn danger",disabled:a.isPending,onClick:u,children:[t.jsx(zn,{size:15})," ",a.isPending?"Deleting…":`Delete ${e}`]}),t.jsx("button",{className:"btn",onClick:r,children:l?"Keep it":"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad requirements delete ${e}`})]}),children:[t.jsx(R,{as:"p",text:n}),l&&t.jsx("div",{className:"stuckbox rm-gap",role:"alert",children:l}),t.jsx("div",{className:"lbl",children:"This removes"}),t.jsx(ik,{items:["The breakdown: its epics, features and stories, and what was decided for you",`The document, its text and its pictures (.squad/requirements/${e})`,"What this computer kept about it: the Analyst's progress and the build switch"]}),t.jsx("div",{className:"lbl",children:"This stays"}),t.jsx(ik,{ok:!0,items:["Tickets that started from its stories, with their code and history",...s?[`Its items in ${s}: squad-kit never deletes there`]:[]]}),t.jsx("p",{className:"rm-note",children:"It cannot be deleted while its stories build. Wait until they merge, or delete those tickets first."})]})}function c4({choices:e,label:n="More actions"}){const[s,r]=N.useState(!1),i=N.useRef(null);return N.useEffect(()=>{if(!s)return;const a=c=>i.current&&!i.current.contains(c.target)&&r(!1),l=c=>{c.key==="Escape"&&(c.preventDefault(),r(!1))};return document.addEventListener("mousedown",a),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",l)}},[s]),e.length?t.jsxs("span",{className:"more rq-more",ref:i,children:[t.jsx("button",{className:"iconbtn","aria-label":n,"aria-haspopup":"menu","aria-expanded":s,title:n,onClick:()=>r(!s),children:t.jsx(Gv,{size:16})}),s&&t.jsx("div",{className:"more-menu",role:"menu",children:e.map(a=>t.jsx("button",{role:"menuitem",className:a.danger?"danger":"",title:a.title,onClick:()=>{r(!1),a.onPick()},children:a.label},a.key))})]}):null}function Uz(e,n){return`${Xd(e.id,e.source.file)}${n?.page?`#page=${n.page}`:""}`}async function Hz(e,n){const s=await fetch(Xd(e,n));if(!s.ok)throw new Error(s.status===404?"not found":`${s.status}`);return s.text()}function d4({v:e,at:n,onClose:s}){const[r,i]=N.useState(null),[a,l]=N.useState(null),c=N.useRef(null),u=Math.max(1,e.source.kind==="pdf"?0:e.source.pages??1);N.useEffect(()=>{let m=!0;const p=Array.from({length:u},(x,g)=>`text/part-${String(g+1).padStart(2,"0")}.md`);return Promise.all(p.map(x=>Hz(e.id,x).catch(()=>""))).then(x=>{m&&(x.some(Boolean)||l("squad-kit could not open the text of this document. Download the original instead."),i(x))}).catch(()=>m&&l("squad-kit could not open the text of this document.")),()=>{m=!1}},[e.id,u]),N.useEffect(()=>{if(!r||!n||!c.current)return;const m=[...c.current.querySelectorAll("h1, h2, h3, h4, h5, h6")],p=g=>{const j=(g.textContent??"").trim().toLowerCase();return n.section&&(j===n.section.toLowerCase()||j.startsWith(`${n.section.toLowerCase()} `))||n.title&&j.includes(n.title.toLowerCase())},x=m.find(p);x&&(x.classList.add("rq-hit"),x.scrollIntoView({block:"start"}))},[r,n]);const h=m=>/^(https?:|data:)/.test(m)?m:Xd(e.id,m.replace(/^(\.\.\/)+/,""));return t.jsx(Ye,{wide:!0,title:e.source.name,onClose:s,footer:t.jsxs(t.Fragment,{children:[n&&t.jsx(R,{className:"note",text:Tl(n)}),t.jsx("span",{className:"grow"}),t.jsxs("a",{className:"btn",href:Xd(e.id,e.source.file),target:"_blank",rel:"noreferrer",download:e.source.name,children:[t.jsx(gs,{size:14})," The original"]}),t.jsx("button",{className:"btn pri",onClick:s,children:"Close"})]}),children:t.jsx("div",{className:"rq-doc",ref:c,children:a?t.jsx("p",{className:"rq-err",children:a}):r?r.map((m,p)=>t.jsx(eg,{remarkPlugins:[ig],rehypePlugins:[m1],components:{img:({src:x,alt:g})=>t.jsx("img",{src:x?h(x):"",alt:g??"",loading:"lazy"}),a:({href:x,children:g})=>t.jsxs("a",{href:x,target:"_blank",rel:"noreferrer",children:[g," ",t.jsx(Xt,{size:11})]})},children:m},p)):t.jsx("p",{className:"note",children:"Opening the document…"})})})}function u4(e){const[n,s]=N.useState(void 0);return{open:r=>{e&&(e.source.kind==="pdf"?window.open(Uz(e,r),"_blank","noopener"):s(r??null))},viewer:n,close:()=>s(void 0)}}function Kz(e,n,s){return El(e).filter(({story:r})=>r.key!==n&&!s.includes(r.key)).map(({story:r})=>({key:r.key,label:`${r.key} ${r.title}`}))}const Vz={gap:"Missing in the BRD",clash:"Two parts clash",check:"A check failed"};function pg(e){if(e.track!=="auto"||!e.waiting)return null;if(e.waiting.kind==="ask"&&e.agentQuestion?.kind&&!e.agentQuestion.answer)return e.agentQuestion.kind;const n=e.waiting.kind==="stuck"?e.stuck?.gate:void 0;return n==="checks"||n==="review"||n==="proof"?"check":null}function h4(e,n){return`/requirements/${encodeURIComponent(e)}${n?`?item=${encodeURIComponent(n)}`:""}`}function Yz(e,n){for(const s of e?.epics??[]){for(const r of s.features)if(r.stories.some(i=>i.key===n))return[s.title,r.title,n].join(" › ");if(s.stories.some(r=>r.key===n))return[s.title,n].join(" › ")}return n}const ak=/\s*\(suggested\)\s*$/i;function Gz(e){return e.map(n=>({text:n.replace(ak,""),suggested:ak.test(n)}))}function Qz(e){return e.stage==="specs"?"planning":e.stage==="implement"?"building":e.stage==="test"?"testing":e.stage==="review"?"reviewing":"working"}function Zz(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`}function Xz(e,n){const s=e.epics.flatMap(l=>[...l.features.flatMap(c=>c.stories),...l.stories]),r=new Set(e.progress.filter(l=>l.state==="merged"||l.state==="released").map(l=>l.key)),i=new Set,a=l=>{for(const c of s)c.dependsOn.includes(l)&&!i.has(c.key)&&(i.add(c.key),a(c.key))};return a(n),s.filter(l=>i.has(l.key)&&!r.has(l.key)).map(l=>`${l.key} ${l.title}`)}function Jz(e,n){if(!e||!n.breakdown)return"";const s=Xz(e,n.breakdown.item),r=!!e.state.build?.on;return s.length?`${Zz(s)} ${s.length===1?"waits":"wait"} for your answer.${r?" The other stories keep building.":""}`:r?"No other story waits for it: the others keep building.":""}function eM(e){return e.ticket||!e.page&&!e.section?null:{...e.section?{section:e.section}:{},...e.page?{page:e.page}:{}}}function p4(e){return ve({queryKey:["requirements",e,"view"],queryFn:()=>ye(`/api/v1/requirements/${e}`),enabled:!!e,refetchInterval:4e3})}function mg({id:e,item:n,children:s,className:r}){const i=vn(),a=h4(e,n),l=c=>{c.metaKey||c.ctrlKey||c.shiftKey||c.button!==0||(c.preventDefault(),i.navigate({href:`${ga}${a}`}))};return t.jsx("a",{className:r,href:`${ga}${a}`,onClick:l,children:s})}function tM({t:e}){return e.track==="auto"?t.jsx("span",{className:"autochip",children:"Builds by itself"}):t.jsxs(t.Fragment,{children:[t.jsx("b",{children:e.track==="express"?"Express":"Full"})," track"]})}function nM({t:e}){const n=p4(e.breakdown?.id).data;return e.breakdown?t.jsxs("div",{className:"brdplace",children:["From"," ",t.jsx(mg,{id:e.breakdown.id,item:e.breakdown.item,children:e.breakdown.id})," ","› ",t.jsx(gb,{path:Yz(n,e.breakdown.item)})]}):null}function sM({t:e}){return e.track!=="auto"?null:t.jsx("span",{className:"prio auto",children:"Builds by itself"})}function rM({t:e}){return e.breakdown?t.jsxs("div",{className:"bkey",title:`From ${e.breakdown.id} › ${e.breakdown.item}`,children:[e.breakdown.id," › ",e.breakdown.item]}):null}function m4({kind:e}){return t.jsx("span",{className:`stoptag ${e}`,children:Vz[e]})}function iM({t:e,extra:n}){const s=re(),r=e.agentQuestion,i=r.kind,a=p4(e.breakdown?.id).data,l=Gz(r.options),[c,u]=N.useState(()=>l.find(k=>k.suggested)?.text??null),[h,m]=$e(e.id,"stop-own",""),p=ct[r.from],x=c===""?h.trim():c,g=Jz(a,e),j=u4(a);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("section",{className:"stopcard","aria-label":"Needs you",children:[t.jsxs("div",{className:"stophead",children:[t.jsx(m4,{kind:i}),t.jsxs("span",{children:["The ",p," found it while ",Qz(e),", ",st(r.at)]})]}),t.jsx(R,{as:"p",className:"stuckq",text:r.text}),t.jsx(aM,{list:r.sources,onOpenRef:a?j.open:void 0}),r.files&&r.files.length>0&&t.jsx(uw,{ticket:e.id,files:r.files}),t.jsxs("div",{className:"opts2",children:[l.map(k=>t.jsxs("button",{className:`opt2 ${c===k.text?"pick":""}`,...ze(k.text),onClick:()=>u(k.text),"aria-pressed":c===k.text,children:[t.jsx("b",{children:t.jsx(R,{text:k.text})}),(k.suggested||c===k.text)&&t.jsxs("span",{className:"optfoot",children:[k.suggested&&t.jsxs("span",{className:"rec",children:[p," suggests"]}),c===k.text&&t.jsxs("span",{className:"yourpick",children:[t.jsx(ce,{size:13,strokeWidth:2.5})," Your pick"]})]})]},k.text)),t.jsx("button",{className:`opt2 ${c===""?"pick":""}`,onClick:()=>u(""),"aria-pressed":c==="",children:t.jsx("b",{children:"Something else…"})})]}),c===""&&t.jsx("textarea",{className:"input",rows:3,style:{width:"100%"},autoFocus:!0,dir:je(h),value:h,placeholder:"Your answer",onChange:k=>m(k.target.value)}),(r.why||g)&&t.jsx(R,{as:"p",className:"stopwhy",text:[r.why,g].filter(Boolean).join(" ")})]}),t.jsx(fg,{t:e}),n]}),a&&j.viewer!==void 0&&t.jsx(d4,{v:a,at:j.viewer??void 0,onClose:j.close}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn you",disabled:!x||s.isPending,onClick:()=>s.mutate({path:`/api/v1/tickets/${e.id}/reply`,body:{text:x},done:`Sent. The ${p} carries on.`}),children:[t.jsx(qs,{size:15})," Answer"]}),!e.chat?.open&&t.jsx(Ai,{t:e,agent:r.from,label:"Ask about this"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad reply ${e.id}${x?` ${Me(x.length>40?`${x.slice(0,40)}…`:x)}`:""}`})]})]})}function aM({list:e,onOpenRef:n}){return e?.length?t.jsxs("p",{className:"stopsrc",children:["Sources:"," ",e.map((s,r)=>{const i=eM(s);return t.jsxs("span",{children:[r>0&&" · ",s.ticket?t.jsx(ge,{to:"/board",search:{ticket:s.ticket},children:t.jsx(R,{text:s.text})}):i&&n?t.jsx("button",{className:"linkbtn",onClick:()=>n(i),title:"Open this place in the document",children:t.jsx(R,{text:s.text})}):t.jsx(R,{text:s.text})]},`${s.text}-${r}`)})]}):null}function f4(e){return e.by==="answer"?"from your answer":`${e.by.charAt(0).toUpperCase()}${e.by.slice(1)}`}function oM({d:e}){const n=e.changed?.ticket;return n?/^c\d+$/.test(n)?t.jsxs("span",{className:"became",children:["It became change ",n," on this ticket."]}):t.jsxs("span",{className:"became",children:["It became"," ",t.jsx(ge,{to:"/board",search:{ticket:n},children:n}),", linked to this one."]}):null}function fg({t:e}){const n=Ei(),[s,r]=N.useState(null),i=e.decided??[];if(!i.length)return null;const a=ln(e,n)||!n;return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Decided for you on this story"}),t.jsx("ul",{className:"decided",children:i.map(l=>t.jsxs("li",{children:[t.jsxs("span",{className:"dwho",children:[f4(l)," · ",st(l.at)]}),l.changed?t.jsxs(t.Fragment,{children:[t.jsx(R,{className:"was",text:l.text}),t.jsx(R,{lead:t.jsx("b",{children:"Now:"}),text:l.changed.text}),t.jsx(oM,{d:l})]}):t.jsxs(t.Fragment,{children:[t.jsx(R,{text:l.text}),a&&t.jsx("button",{className:"linkbtn",onClick:()=>r(l),children:"Change"})]})]},l.id))}),s&&t.jsx(lM,{t:e,d:s,onClose:()=>r(null)})]})}function lM({t:e,d:n,onClose:s}){const r=re(),{toast:i}=Le(),[a,l,c]=$e(e.id,`decided-${n.id}`,""),u=tr(e),h=a.trim();return t.jsxs(Ye,{title:"Change what was decided",icon:t.jsx(Ps,{size:16}),onClose:s,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!h||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/decided/${n.id}`,body:{text:h}},{onSuccess:m=>{i(Hb(e.id,m?.decided?.find(p=>p.id===n.id)?.changed?.ticket)),c(),s()}}),children:[t.jsx(Ps,{size:15})," Change it"]}),t.jsx("button",{className:"btn",onClick:s,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad decided ${e.id} ${n.id} ${Me(h||"what you want instead")}`})]}),children:[t.jsx("p",{className:"note",style:{marginBottom:8},children:n.by==="answer"?"From your answer, the squad decided:":`The ${f4(n)} decided:`}),t.jsx(R,{as:"div",className:"decidedq",text:n.text}),t.jsx("label",{className:"lbl",htmlFor:"decided-instead",style:{marginTop:0},children:"What do you want instead?"}),t.jsx("textarea",{id:"decided-instead",className:"input",rows:3,style:{width:"100%"},autoFocus:!0,dir:je(a),value:a,onChange:m=>l(m.target.value),placeholder:"For example: the refund goes back as store credit"}),t.jsx("p",{className:"note",style:{marginTop:8},children:u?`${e.id} is merged, so this becomes a new ticket linked to it.`:"It becomes a small change on this ticket: the Analyst writes it into the spec, you approve it, and the Builder makes it."})]})}function gg(){return ve({queryKey:["requirements","waiting"],queryFn:()=>ye("/api/v1/requirements/waiting"),enabled:!!gt,refetchInterval:3e3}).data?.breakdowns??[]}function g4(){const n=(ve({queryKey:["app","projects"],queryFn:()=>ye("/api/v1/app/projects"),refetchInterval:2e3}).data?.projects??[]).filter(r=>r.open);return W8({queries:n.map(r=>({queryKey:["app","requirements-waiting",r.id],queryFn:()=>ye(`/p/${encodeURIComponent(r.id)}/api/v1/requirements/waiting`),refetchInterval:3e3,retry:!1}))}).flatMap((r,i)=>(r.data?.breakdowns??[]).map(a=>({...a,project:{id:n[i].id,name:n[i].name}})))}function x4(e){return`/p/${encodeURIComponent(e.project.id)}${h4(e.id)}`}function cM(e){return`squad requirements answer ${e.id}${e.project?` --project ${Ci(e.project.name)}`:""}`}function Pf(e){return`The Analyst has ${e.questions} ${e.questions===1?"question":"questions"}`}function dM({w:e}){return t.jsxs("div",{className:"yitem",title:`${e.project?`${e.project.name} · `:""}${e.id} · ${e.title}
710
+ ${Pf(e)}`,children:[t.jsx("span",{className:"yid",children:e.project?`${e.project.name} · ${e.id}`:e.id}),t.jsx("span",{className:"yline",children:Pf(e)}),e.project?t.jsx("a",{className:"btn sm you",href:x4(e),children:"Answer"}):t.jsx(mg,{id:e.id,className:"btn sm you",children:"Answer"})]})}function y4({w:e}){return t.jsxs("div",{className:"wcard",style:{padding:"16px 18px 16px 22px"},children:[t.jsxs("div",{className:"grow",children:[t.jsxs("div",{className:"meta",children:[e.project&&t.jsx("span",{className:"pill sm",children:e.project.name}),t.jsx("span",{className:"id",children:e.id}),t.jsx("span",{children:"Requirements"}),t.jsx("span",{children:st(e.since)})]}),t.jsx(R,{as:"h3",text:e.title}),t.jsxs("p",{children:[Pf(e),". It writes the breakdown once you answer."]})]}),t.jsx(X,{text:cM(e)}),e.project?t.jsx("a",{className:"btn pri sm",href:x4(e),children:"Answer"}):t.jsx(mg,{id:e.id,className:"btn pri sm",children:"Answer"})]})}function j4({t:e}){const n=pg(e);return n?t.jsx(m4,{kind:n}):null}function k4(){return ve({queryKey:["app","waiting"],queryFn:()=>ye("/api/v1/app/waiting"),refetchInterval:2e3})}function ok(){const e=De(),n=zr({select:a=>a.location.pathname}),s=e.data?.ready?e.data:null,r=N.useMemo(()=>(s?.tickets??[]).filter(ju).map(a=>({key:a.id,since:Ab(a),ticket:a})),[s]),i=gg();return v4(s?.meta.project,Eb(s?.tickets??[],i.length)),S4(),n.startsWith("/inbox")?null:t.jsx(b4,{items:r,breakdowns:i})}function uM(){const e=k4(),n=N.useMemo(()=>(e.data?.items??[]).map(({project:r,ticket:i})=>({key:`${r.id}/${i.id}`,since:Ab(i),ticket:i,project:r})),[e.data]),s=g4();return v4("squad-kit",n.length+s.length),S4(),t.jsx(b4,{items:n,breakdowns:s,home:!0})}function v4(e,n){N.useEffect(()=>{e&&(document.title=hC(e,n))},[e,n])}function hM(e){const[n,s]=N.useState(Date.now);return N.useEffect(()=>{const r=setInterval(()=>s(Date.now()),e);return()=>clearInterval(r)},[e]),n}function b4({items:e,home:n,breakdowns:s=[]}){const[r]=N.useState(()=>new mC),i=hM(3e4),a=N.useMemo(()=>r.sort(e),[r,e]),l=a.length+s.length;if(!l)return null;const c=a.slice(0,2),u=s.slice(0,2-c.length),h=l-c.length-u.length,m=l===1?"1 thing needs you":`${l} things need you`,p=x=>h>0&&(n?t.jsxs("button",{className:`ymore ${x}`,onClick:()=>document.getElementById("waiting")?.scrollIntoView({behavior:"smooth",block:"start"}),children:["and ",h," more"]}):t.jsxs(ge,{to:"/inbox",className:`ymore ${x}`,children:["and ",h," more"]}));return t.jsxs("section",{className:"ybar","aria-label":"Waiting for you",children:[t.jsx("span",{className:"ybar-n","aria-hidden":!0,children:l}),t.jsx("b",{className:"ybar-t","aria-live":"polite",title:n?"The squads keep working on everything else meanwhile.":"The squad keeps working on everything else meanwhile.",children:m}),t.jsxs("div",{className:"ybar-items",children:[c.map(x=>t.jsx(pM,{it:x,now:i},x.key)),u.map(x=>t.jsx(dM,{w:x},`${x.project?.id??""}/${x.id}`))]}),p("ymore-row"),t.jsx(xM,{})]})}function pM({it:e,now:n}){const s=e.ticket,r=Xs(s)?Si(s):void 0,i=s.waiting?.summary??(r?`Change ${r.id} to the spec waits for you`:Rs(s)?j1(s):s.outdated?.length?x1(s):`Looks stuck: ${s.quiet?.detail??"no progress"}`),a=s.waiting?zd(s):r?"Check the change":"Check it",l=s.waiting?.kind==="ask"&&s.agentQuestion?`“${s.agentQuestion.text}”`:s.title,c=[e.project?.name,s.id,er[s.stage],pC(e.since,n)].filter(Boolean).join(" · ");return t.jsxs("div",{className:"yitem",title:`${c}
711
+ ${i}
712
+ ${l}`,children:[t.jsx("span",{className:"yid",children:e.project?`${e.project.name} · ${s.id}`:s.id}),pg(s)?t.jsxs("span",{className:"yline",...ze(s.title),children:[t.jsx(j4,{t:s}),t.jsx(R,{text:s.title})]}):t.jsx(R,{className:"yline",text:i}),e.project?t.jsx("a",{className:"btn sm you",href:Rb(e.project.id,s),children:a}):s.waiting?.kind==="proof"?t.jsx(ge,{to:"/tickets/$id/proof",params:{id:s.id},className:"btn sm you",children:a}):t.jsx(ge,{to:"/board",search:{ticket:s.id},className:"btn sm you",children:a})]})}const w4="sk.notices";function hl(){try{return window.localStorage}catch{return null}}function xg(){const e=hl()?.getItem(w4);return e==="on"||e==="off"?e:null}function yg(){return typeof Notification>"u"?window.isSecureContext===!1?"insecure":"none":window.isSecureContext===!1?"insecure":Notification.permission}let jg=!1;function lk(e){jg=e,N4()}const Rf=new Set,N4=()=>Rf.forEach(e=>e());function mM(e){return Rf.add(e),window.addEventListener("storage",e),window.addEventListener("focus",e),document.addEventListener("visibilitychange",e),()=>{Rf.delete(e),window.removeEventListener("storage",e),window.removeEventListener("focus",e),document.removeEventListener("visibilitychange",e)}}const fM=()=>`${xg()??""}|${yg()}|${jg?"asking":""}`;function bm(e){try{hl()?.setItem(w4,e)}catch{}N4()}function gM(){try{new Notification("Desktop notices are on",{body:"squad-kit shows one like this for each new thing that needs you.",tag:"sk-notices-on",silent:!0})}catch{}}function kg(){const{toast:e}=Le(),[n,s,r]=N.useSyncExternalStore(mM,fM).split("|"),i=n||null;return{choice:i,permission:s,asking:r==="asking",on:i==="on"&&s==="granted",canAsk:i===null&&(s==="default"||s==="granted"),turnOn:async()=>{if(jg)return;lk(!0);let l="error";try{l=await NC(typeof Notification>"u"?void 0:Notification,{secure:window.isSecureContext!==!1})}finally{lk(!1)}const c=SC(l);c.choice&&bm(c.choice),c.test&&gM(),e(c.say,c.bad?"err":void 0)},turnOff:()=>{bm("off"),e("Desktop notices are off")},notNow:()=>{bm("off"),e("No desktop notices. Turn them on in Settings any time.")}}}function xM(){const e=kg();return!e.canAsk&&!e.asking?null:t.jsxs("div",{className:"ybar-ask","aria-live":"polite",title:e.asking?qb:"Get a desktop notice when the squad needs you",children:[t.jsx(Ym,{size:14}),t.jsx("button",{className:"linkbtn",disabled:e.asking,onClick:()=>void e.turnOn(),children:e.asking?"Waiting for your browser…":"Desktop notices"}),!e.asking&&t.jsx("button",{className:"linkbtn quiet",onClick:e.notNow,"aria-label":"No desktop notices",children:"Not now"})]})}function yM(){const e=kg();return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Desktop notices"}),t.jsx("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:e.permission==="none"?t.jsx("span",{className:"note",children:"This browser can't show desktop notices. The banner and the tab title still show what needs you."}):e.permission==="insecure"?t.jsx("span",{className:"note",children:"Your browser shows desktop notices only on a secure page. Open the board on this computer, at its 127.0.0.1 or localhost address, to turn them on."}):e.permission==="denied"?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"pill you",children:"Blocked by your browser"}),t.jsx("span",{className:"note",children:Mo})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn sm",disabled:e.asking,onClick:()=>e.on?e.turnOff():void e.turnOn(),children:e.asking?"Waiting for your browser…":e.on?"On: turn them off":"Off: turn them on"}),t.jsx("span",{className:"note","aria-live":"polite",children:e.asking?qb:e.choice==="on"&&e.permission==="default"?`You turned them on, but your browser has not allowed them yet. ${Mo}`:"A notice for each new question, approval, proof and failure, in this browser. No sounds."})]})})]})}const jM=new kC;function S4(){vM();const e=k4(),n=_t(),s=e.data;N.useEffect(()=>{if(!s)return;const r=jM.next(jC(s.items),Date.now());if(!r.length||xg()!=="on"||yg()!=="granted")return;const i=a=>{if(a.project.id!==gt)return window.location.assign(Rb(a.project.id,a.ticket));if(a.ticket.waiting?.kind==="proof")return void n({to:"/tickets/$id/proof",params:{id:a.ticket.id}});n({to:"/board",search:{ticket:a.ticket.id}})};for(const a of r)Pb(a.key,Date.now(),hl())&&kM(a,i)},[s,n])}function kM(e,n){const{title:s,body:r}=bC(e);C4(s,r,e.key,()=>n(e))}function C4(e,n,s,r){try{const i=new Notification(e,{body:n,tag:s,silent:!0});i.onclick=()=>{window.focus(),i.close(),r()}}catch{}}function vM(){const e=rl(hl()).length>0,s=ve({queryKey:["app","projects"],queryFn:()=>ye("/api/v1/app/projects"),refetchInterval:2e3,enabled:e}).data;N.useEffect(()=>{if(!s)return;const r=hl();for(const i of AC(s.projects,rl(r))){if(EC(r,i.id),xg()!=="on"||yg()!=="granted"||!Pb(`setup/${i.id}`,Date.now(),r))continue;const{title:a,body:l}=PC(i.name);C4(a,l,`setup/${i.id}`,()=>window.location.assign(`/p/${encodeURIComponent(i.id)}/overview`))}},[s])}function Ou(){const e=De(),n=gg().length;return Eb(e.data?.ready?e.data.tickets:[],n)}let Er=new Map;const qf=new Set;function ck(){Er=new Map(Er);for(const e of qf)e()}const $4={has:e=>Er.has(e),focus:e=>Er.get(e)?.(),add(e,n){return Er.set(e,n),ck(),()=>{Er.get(e)===n&&(Er.delete(e),ck())}}};function bM(){return N.useSyncExternalStore(e=>(qf.add(e),()=>qf.delete(e)),()=>Er)}function vg(e){const n=e?.querySelector("textarea");(n??e)?.scrollIntoView?.({block:"nearest"}),n?.focus()}function bg(e,n){const s=N.useRef(n);s.current=n,N.useEffect(()=>e?$4.add(e,()=>s.current()):void 0,[e])}function Jd(e=""){return ve({queryKey:["conversations",e],queryFn:()=>ye(`/api/v1/conversations${e?`?q=${encodeURIComponent(e)}`:""}`),refetchInterval:1500})}function wg(e,n){if(!e.open)return 0;const s=n[e.id];return s===void 0?e.fresh:Math.min(e.fresh,Math.max(0,e.count-s))}const T4={analyst:"An",architect:"Ar",builder:"Bu",reviewer:"Re",tester:"Te"};function _u(e=4e3){return ve({queryKey:["lead"],queryFn:()=>ye("/api/v1/lead"),refetchInterval:e})}function E4(e){return ve({queryKey:["lead","conversation",e],queryFn:()=>ye(`/api/v1/lead/conversations/${encodeURIComponent(e)}`),enabled:!!e,refetchInterval:n=>n.state.data?.thinking?1e3:!1})}function wM(){return ve({queryKey:["lead","rules"],queryFn:()=>ye("/api/v1/lead/rules")})}function NM(){return ve({queryKey:["lead","can"],queryFn:()=>ye("/api/v1/lead/can"),staleTime:1/0})}const wm=6,SM=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform)?"⌘K":"Ctrl K";function CM({s:e,here:n,noLead:s}){const r=Jd(),i=r.data??[],a=r.isSuccess,l=De(),c=_u(5e3).data,u=l.data?.ready?l.data.tickets:[],h=i.filter(j=>j.open).sort((j,k)=>k.at.localeCompare(j.at)),m=[...new Set([...e.open.filter(j=>j.id!=="lead").map(j=>j.id),...h.map(j=>j.id)])],p=Ou(),x=l.data?.ready&&a?[...u,...l.data.archived??[]].map(j=>j.id).concat(i.map(j=>j.id)).join(" "):"";N.useEffect(()=>{x&&Nt.prune(new Set(x.split(" ")))},[x]);const g=c?.conversations.some(j=>j.thinking)??!1;return s&&!m.length?null:t.jsxs("div",{className:"heads","aria-label":"Chats",children:[!s&&t.jsx(A4,{id:"lead",cls:"lead",on:Yb(e,"lead"),badge:p,live:g,tip:"Squad lead",small:`${p?`${p} ${p===1?"thing needs":"things need"} you`:"Ask anything"} · ${SM}`,nudge:p,children:t.jsx(Ma,{size:30})}),m.slice(0,wm).map((j,k)=>t.jsx($M,{id:j,i:k,s:e,here:n.has(j),t:u.find(b=>b.id===j),talk:i.find(b=>b.id===j)},j)),m.length>wm&&t.jsx(ge,{to:"/conversations",className:"head more",title:"Every conversation",children:t.jsxs("span",{className:"face",children:["+",m.length-wm]})})]})}function $M({id:e,i:n,s,here:r,t:i,talk:a}){const l=a?.with??(i?N1(i):"analyst"),c=!r&&Yb(s,e),u=a?wg(a,s.seen):0,h=i&&w1(i)&&i.waitKey&&s.looked[e]!==i.waitKey?1:0,m=r?"On this page":a?.thinking?"Writing…":i?.waiting?i.waiting.summary:a?.yourTurn?"Your turn":"Talking it through";return t.jsx(A4,{id:e,cls:`av-${l}`,on:c,here:r,badge:c||r?0:u+h,live:!!a?.thinking,tip:`${ct[l]} ${e}`,small:m,nudge:(a?.count??0)+(i?.waitKey?1:0),nudgeKey:i?.waitKey,delay:120+n*90,sid:e,children:t.jsx("span",{className:"face",children:T4[l]})})}function A4({id:e,cls:n,on:s,here:r,badge:i,live:a,tip:l,small:c,nudge:u,nudgeKey:h,delay:m,sid:p,children:x}){const[g,j]=N.useState(!1),k=N.useRef({nudge:u,nudgeKey:h});return N.useEffect(()=>{const b=k.current;k.current={nudge:u,nudgeKey:h};const w=u>b.nudge||h!==void 0&&h!==b.nudgeKey;if(s||r||!w||window.matchMedia?.(Al).matches)return;j(!0);const S=setTimeout(()=>j(!1),750);return()=>clearTimeout(S)},[u,h,s,r]),t.jsxs("button",{className:`head ${n} ${s?"on":""} ${r?"here":""} ${g?"ping":""}`,style:m?{animationDelay:`${m}ms`}:void 0,onClick:()=>r?$4.focus(e):Nt.toggle(e),"aria-label":`${l}${i?`, ${i} new`:""}${s?", open":""}${r?", on this page":""}`,"aria-pressed":s,children:[x,p&&t.jsx("span",{className:"sid",children:p}),i>0&&t.jsx("span",{className:"n",children:i}),a&&t.jsx("span",{className:"live","aria-hidden":"true"}),t.jsxs("span",{className:"tip",role:"tooltip",children:[l,t.jsx("small",{children:c})]})]})}function P4(){const e=re(),n=Ot();return{send:(r,i)=>e.mutate({path:r.conversation?`/api/v1/lead/conversations/${encodeURIComponent(r.conversation)}/messages`:"/api/v1/lead/conversations",body:{text:r.text,...r.context?{context:r.context}:{},...r.fresh?{fresh:!0}:{}},after:a=>{lf.add(`${a.id}.${a.turns.at(-1)?.n??0}`),n.setQueryData(["lead","conversation",a.id],a),i(a)}}),busy:e.isPending}}function R4({id:e,value:n,onChange:s,onSend:r,busy:i,placeholder:a,chip:l,autoFocus:c}){const u=N.useRef(null);N.useEffect(()=>{if(!c)return;const g=u.current;g?.focus(),g?.setSelectionRange(g.value.length,g.value.length)},[c]);const h=n.trim().length>0&&!i,[m,p]=N.useState(!1),x=()=>{p(!0),setTimeout(()=>p(!1),220),r()};return t.jsxs("div",{className:"lead-box",children:[t.jsx("textarea",{id:e,ref:u,rows:1,value:n,dir:je(n),placeholder:a,"aria-label":"Your question",onChange:g=>s(g.target.value),onKeyDown:g=>{g.key==="Enter"&&!g.shiftKey&&!g.nativeEvent.isComposing&&(g.preventDefault(),h&&x())}}),t.jsxs("div",{className:"lead-bar",children:[l,t.jsx("span",{className:"grow"}),t.jsx("button",{className:`lead-send ${m?"go":""}`,disabled:!h,onClick:x,"aria-label":"Send",title:"Send (Enter)",children:t.jsx(Zn,{size:17,strokeWidth:2.4})})]})]})}function q4({ctx:e}){return t.jsxs("span",{className:"lt-ctx",title:"The lead reads this first, so you do not have to describe it",children:[t.jsx(Pa,{size:12,"aria-hidden":"true"}),kw(e)]})}function TM(){return t.jsxs("p",{className:"lead-hint",children:[t.jsx(ja,{size:13,"aria-hidden":"true"}),"It reads and looks on its own. It changes nothing without your OK: changes come as stories you create."]})}function Ng({text:e,context:n,label:s="Ask the lead",className:r="btn"}){return t.jsxs("button",{className:r,onClick:()=>dg.open({...e?{text:e}:{},context:n}),children:[t.jsx(Ma,{size:14,className:"lead-ic"}),s]})}function Sg({t:e,problem:n,className:s}){const r=n==="error"?e.stuck?.title??e.stuck?.question:void 0;return t.jsx(Ng,{text:vw(n,e.id),context:{from:"problem",problem:n,story:e.id,...r?{error:r.slice(0,400)}:{}},...s?{className:s}:{}})}function EM({t:e}){return t.jsxs("div",{className:"lead-strip",children:[t.jsx(Ma,{size:15,className:"lead-ic"}),t.jsx("span",{children:"Not sure what to do here? The Squad lead reads this story and tells you, in plain words."}),t.jsx(Sg,{t:e,problem:"waiting",className:"btn sm"})]})}function I4(e){const n=re();return{press:r=>n.mutate({path:`/api/v1/lead/cards/${encodeURIComponent(e.id)}/run`,body:r}),busy:n.isPending}}function F4({card:e,stories:n,breakdown:s}){return e.status==="dismissed"?t.jsx("div",{className:"lc-f lc-quiet",children:"Put aside. Nothing was done."}):t.jsxs("div",{className:"done",role:"status",children:[t.jsx(ce,{"aria-hidden":"true"}),t.jsx(R,{text:e.result??"Done."}),n?.map(r=>t.jsx(ge,{to:"/board",search:{ticket:r},className:"lc-link",children:r},r)),s&&t.jsx(ge,{to:"/requirements/$id",params:{id:s},className:"lc-link",children:s})]})}function AM({card:e}){const{press:n,busy:s}=I4(e),r=e.split,i=Fa(`${e.title} ${e.ask}`),a=Wr[i],l=r.size==="few",c=l?a.title(r.parts.length):a.brd.title,u=e.status==="open";return t.jsxs("section",{className:`decide splitcard ${u?"":"decided"}`,dir:i==="ar"?"rtl":"ltr",lang:i,"aria-label":`${c}: ${e.title}`,children:[t.jsxs("div",{className:"dh",children:[t.jsx("b",{children:c}),t.jsx("span",{className:"who",children:a.who})]}),t.jsxs("div",{className:"db",children:[l&&r.why&&t.jsx(R,{as:"p",className:"sum",text:r.why}),l?t.jsx(Su,{s:r,w:a,...e.stories?{ids:e.stories}:{}}):t.jsx(Cu,{s:r,w:a})]}),u?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"df",children:[t.jsx("button",{className:"btn pri",disabled:s,onClick:()=>n({choice:l?"split":"requirements"}),children:l?a.create(r.parts.length):a.brd.send}),t.jsx("button",{className:"btn",disabled:s,onClick:()=>n({choice:"one"}),children:l?a.one:a.brd.anyway}),t.jsx("button",{className:"btn ghost",disabled:s,onClick:()=>n({dismiss:!0}),children:a.discard}),t.jsx(X,{text:`${e.command} ${l?"--split":"--requirements"}`})]}),e.result&&t.jsx(R,{as:"p",className:"refused",text:e.result}),t.jsx("p",{className:"yours",children:t.jsx("bdi",{children:l?a.hint:a.brd.hintText})})]}):t.jsx(F4,{card:e,...e.stories?{stories:e.stories}:e.story?{stories:[e.story]}:{},...e.breakdown?{breakdown:e.breakdown}:{}})]})}function PM({card:e}){const{press:n,busy:s}=I4(e),r=Wr[e.lang];return t.jsxs("section",{className:`decide splitcard ${e.status==="open"?"":"decided"}`,dir:e.lang==="ar"?"rtl":"ltr",lang:e.lang,"aria-label":r.brd.title,children:[t.jsxs("div",{className:"dh",children:[t.jsx("b",{children:r.brd.title}),t.jsx("span",{className:"who",children:r.who})]}),t.jsxs("div",{className:"db brd",children:[t.jsx("p",{children:r.brd.why}),e.found.length>0&&t.jsx("p",{className:"found",children:r.found(e.found)})]}),e.status==="open"?t.jsxs("div",{className:"df",children:[t.jsx("button",{className:"btn pri",disabled:s,onClick:()=>n({}),children:r.brd.send}),t.jsx("button",{className:"btn ghost",disabled:s,onClick:()=>n({dismiss:!0}),children:r.notNow}),t.jsx(X,{text:e.command})]}):t.jsx(F4,{card:e,...e.breakdown?{breakdown:e.breakdown}:{}})]})}function Cg(e){const n=re();return{press:(r={},i)=>n.mutate({path:`/api/v1/lead/cards/${encodeURIComponent(e.id)}/run`,body:r,...i?{done:i}:{}}),busy:n.isPending}}const RM={quality:"Quality","commands.start":"the start command","commands.url":"the app's address","commands.setup":"the setup command","commands.test":"the test command","commands.lint":"the code check command","commands.build":"the build command"};function qM({card:e}){switch(e.kind){case"draft_story":return e.split?t.jsx(AM,{card:e}):t.jsx(IM,{card:e});case"requirements":return t.jsx(PM,{card:e});case"engineer_report":return t.jsx(LM,{card:e});case"open_story":return t.jsx(z4,{card:e});case"decide":return t.jsx(Sw,{story:e.story,made:e.key,fromLead:!0});default:return t.jsx(FM,{card:e})}}function $g({card:e}){return t.jsx("span",{className:`lvl ${e.level===2?"ok":""}`,children:mT(e)})}function L4({card:e,story:n}){return e.status==="dismissed"?t.jsx("div",{className:"lc-f lc-quiet",children:"Put aside. Nothing was done."}):t.jsxs("div",{className:"lc-f lc-done",role:"status",children:[t.jsx(ce,{size:15,strokeWidth:2.6,"aria-hidden":"true"}),t.jsx(R,{text:e.byItself??e.result??"Done."}),n&&t.jsxs(ge,{to:"/board",search:{ticket:n},className:"lc-link",children:["Open ",n]})]})}function IM({card:e}){const{press:n,busy:s}=Cg(e),[r,i]=N.useState(!1),[a,l]=N.useState(e.title),[c,u]=N.useState(e.ask),[h,m]=N.useState(e.doneWhen),p=e.status==="open",x=a!==e.title||c!==e.ask||JSON.stringify(h)!==JSON.stringify(e.doneWhen),g=()=>n(x?{edits:{title:a,ask:c,doneWhen:h.filter(k=>k.text.trim())}}:{}),j=(k,b)=>m(w=>w.map((S,T)=>T===k?{...S,...b}:S));return t.jsxs("section",{className:"lc lc-draft","aria-label":`${e.storyKind==="bug"?"Bug":"Story"} draft: ${e.title}`,children:[t.jsxs("header",{className:"lc-h",children:[t.jsx("b",{children:e.storyKind==="bug"?"Bug draft":"Story draft"}),t.jsxs("span",{className:"lc-sub",children:["· ",e.storyKind==="bug"?"Bug":"Feature"," · from this conversation"]}),t.jsx($g,{card:e})]}),t.jsxs("div",{className:"lc-b",children:[r&&p?t.jsxs("div",{className:"lc-edit",children:[t.jsxs("label",{children:[t.jsx("span",{children:"Title"}),t.jsx("input",{className:"input",value:a,dir:je(a),onChange:k=>l(k.target.value)})]}),t.jsxs("label",{children:[t.jsx("span",{children:"What it is about"}),t.jsx("textarea",{className:"input",rows:3,value:c,dir:je(c),onChange:k=>u(k.target.value)})]}),t.jsx("div",{className:"dw",children:"Done when · and how it will be proved"}),t.jsx("ol",{className:"lc-rows",children:h.map((k,b)=>t.jsxs("li",{children:[t.jsx("input",{className:"input",value:k.text,dir:je(k.text),"aria-label":`Done when ${b+1}`,onChange:w=>j(b,{text:w.target.value})}),t.jsx("select",{className:"input",value:k.proof,"aria-label":`How done when ${b+1} will be proved`,onChange:w=>j(b,{proof:w.target.value}),children:Object.keys(em).map(w=>t.jsx("option",{value:w,children:em[w]},w))}),t.jsx("button",{className:"iconbtn",onClick:()=>m(w=>w.filter((S,T)=>T!==b)),"aria-label":`Remove done when ${b+1}`,disabled:h.length<2,children:t.jsx(Ue,{size:14})})]},b))}),h.length<8&&t.jsxs("button",{className:"linkbtn",onClick:()=>m(k=>[...k,{text:"",proof:"screen"}]),children:[t.jsx(jt,{size:13}),' Add a "done when"']})]}):t.jsxs(t.Fragment,{children:[t.jsx(R,{as:"div",className:"lc-t",text:a}),c&&c!==a&&t.jsx(R,{as:"div",className:"lc-a",text:c}),t.jsx("div",{className:"dw",children:"Done when · and how it will be proved"}),t.jsx("ol",{className:"dwl",children:h.map((k,b)=>t.jsxs("li",{children:[t.jsx("span",{className:"n",children:b+1}),t.jsx(R,{className:"txt",text:k.text}),t.jsx("span",{className:`kind ${k.proof}`,children:em[k.proof]})]},b))})]}),e.warnings.map(k=>t.jsxs("div",{className:"lc-warn",children:[t.jsx(Is,{size:15,"aria-hidden":"true"}),t.jsx(R,{text:k})]},k)),p&&e.result&&t.jsx(R,{as:"p",className:"lc-why",text:e.result})]}),p?t.jsxs("div",{className:"lc-f",children:[t.jsx("button",{className:"btn go",disabled:s||!a.trim()||!h.some(k=>k.text.trim()),onClick:g,children:"Create story"}),t.jsx("button",{className:"btn",disabled:s,onClick:()=>i(!r),"aria-pressed":r,children:r?"Done editing":"Edit"}),t.jsx("button",{className:"btn ghost",disabled:s,onClick:()=>n({dismiss:!0}),children:"Discard"}),t.jsx("span",{className:"lc-after",children:"Becomes a new story in Tickets. Nothing starts until you press Start."}),t.jsx(X,{text:e.command})]}):t.jsx(L4,{card:e,...e.story?{story:e.story}:{}})]})}function z4({card:e}){const n=uT(e.open),s={className:"btn lt-open",title:e.why??"Opens it on the board. Nothing changes."},r=t.jsxs(t.Fragment,{children:[t.jsx(Vm,{size:14,"aria-hidden":"true"})," ",e.label]});return n?.to==="/tickets/$id/proof"?t.jsx(ge,{to:"/tickets/$id/proof",params:{id:n.id},...s,children:r}):t.jsx(ge,{to:"/board",search:{ticket:e.story,...n?.to==="/board"&&n.tab?{tab:n.tab}:{}},...s,children:r})}function FM({card:e}){const{press:n,busy:s}=Cg(e),[r,i]=N.useState(e.kind==="send_answer"?e.text:""),a=fT(e),l=e.kind==="board_action"||e.kind==="send_answer"?e.story:void 0,c=e.kind==="send_answer"?`An answer for ${e.story}`:e.kind==="settings_change"?`Change ${RM[e.setting]??e.setting} to ${e.value}`:`${e.label}${e.story?` · ${e.story}`:""}`,u=e.label,h=e.status==="open"&&!e.byItself;return t.jsxs("section",{className:"lc","aria-label":c,children:[t.jsxs("header",{className:"lc-h",children:[t.jsx("b",{children:c}),t.jsx($g,{card:e})]}),(e.why||e.kind==="send_answer"||e.asksFirst||e.kind==="settings_change"&&e.technical||h&&e.result)&&t.jsxs("div",{className:"lc-b",children:[e.why&&t.jsx(R,{as:"p",className:"lc-a",text:e.why}),e.kind==="send_answer"&&(h?t.jsx("textarea",{className:"input",rows:3,value:r,dir:je(r),"aria-label":"The answer to send",onChange:m=>i(m.target.value)}):t.jsx(R,{as:"p",className:"lc-quote",text:e.text})),e.kind==="settings_change"&&e.technical&&t.jsx("p",{className:"note",children:"A technical setting: only an engineer changes it."}),e.asksFirst&&h&&t.jsx("p",{className:"note",children:"It came from what the lead read, not from your words, so it asks you first even with Always allow on."}),h&&e.result&&t.jsx(R,{as:"p",className:"lc-why",text:e.result})]}),h?t.jsxs("div",{className:"lc-f",children:[t.jsx("button",{className:"btn pri",disabled:s||e.kind==="send_answer"&&!r.trim(),onClick:()=>n(e.kind==="send_answer"&&r.trim()!==e.text?{edits:{text:r}}:{}),children:u}),a&&t.jsx("button",{className:"btn",disabled:s,onClick:()=>n({always:!0}),title:"Runs by itself from now on, without asking. Only for low-risk actions.",children:gT(e)}),t.jsx("button",{className:"btn ghost",disabled:s,onClick:()=>n({dismiss:!0}),children:"Not now"}),t.jsx(X,{text:e.command})]}):t.jsx(L4,{card:e,...l?{story:l}:{}})]})}function LM({card:e}){const{press:n,busy:s}=Cg(e),{toast:r}=Le(),i=()=>void navigator.clipboard?.writeText(e.report??"").then(()=>r("Copied the report"),()=>r("Could not copy. Select the text instead.","err"));return t.jsxs("section",{className:"lc","aria-label":"A report for an engineer",children:[t.jsxs("header",{className:"lc-h",children:[t.jsx("b",{children:"A report for an engineer"}),t.jsx($g,{card:e})]}),t.jsxs("div",{className:"lc-b",children:[t.jsx("p",{className:"lc-a",children:e.why??"What happened, the steps and the logs, with no secrets in it. Nothing is sent: you copy it and send it yourself."}),e.report&&t.jsx("pre",{className:"lc-report",children:e.report}),e.status==="open"&&e.result&&t.jsx(R,{as:"p",className:"lc-why",text:e.result})]}),t.jsxs("div",{className:"lc-f",children:[e.report?t.jsxs("button",{className:"btn pri",onClick:i,children:[t.jsx(Mn,{size:14})," Copy the report"]}):t.jsx("button",{className:"btn pri",disabled:s,onClick:()=>n(),children:"Prepare a report"}),e.report&&t.jsx("span",{className:"lc-after",children:"Nothing was sent."}),t.jsx(X,{text:e.command})]})]})}function M4({c:e,turn:n,last:s,onAgain:r}){const i=!!(e.thinking&&s&&!n.answer&&!n.error),a=n.ask.context,l=a.from!=="board"||a.page!==void 0&&a.page!=="Squad lead",c=`${e.id}.${n.n}`,u=N.useRef(i||lf.has(c));i&&(u.current=!0);const h=n.answer??(i&&n.draft?.headline?{headline:n.draft.headline,body:n.draft.body??""}:null),m=h?.headline??"",p=h?yw(m,h.body):"",x=Jb(`${m}
713
+ ${p}`,u.current),g={shown:x.shown,head:Ld(m),done:x.done&&!i};return N.useEffect(()=>{g.done&&lf.delete(c)},[g.done,c]),t.jsxs("div",{className:`lt ${u.current?"watched":""}`,children:[t.jsxs("div",{className:"lt-you",children:[t.jsx(R,{as:"p",text:n.ask.text}),t.jsxs("div",{className:"lt-when",title:l?aT(a):void 0,children:[t.jsx("span",{children:tn(n.ask.at)}),l&&t.jsxs(t.Fragment,{children:[t.jsx("span",{"aria-hidden":"true",children:"·"}),t.jsx(Pa,{size:12,"aria-hidden":"true"}),t.jsx("bdi",{children:oT(a)})]})]})]}),i?t.jsxs(t.Fragment,{children:[t.jsx(OM,{c:e,turn:n}),h&&t.jsx("div",{className:"lt-answer",children:t.jsx(_4,{head:m,body:p,said:g})})]}):t.jsxs(t.Fragment,{children:[n.trace.length>0&&n.answer?.by!=="refusal"&&t.jsx(zM,{trace:n.trace,seconds:n.seconds}),n.answer&&t.jsx(_M,{answer:n.answer,said:g}),n.error&&t.jsxs("div",{className:"lt-err",role:"status",children:[t.jsx(R,{as:"p",text:n.error}),s&&t.jsx("button",{className:"btn sm",onClick:()=>r(n.ask.text),children:"Ask again"})]}),(n.error||n.answer&&g.done)&&t.jsxs("div",{className:"lt-cost rise",title:n.model?`Ran on ${n.model}`:void 0,children:[t.jsx("bdi",{children:iT(n)}),n.answer?.by==="note"&&s&&t.jsx("button",{className:"linkbtn",onClick:()=>r(n.ask.text,!0),title:"Looks again in the code and the app, past the saved note. It costs like any question.",children:"Look again"})]})]})]})}function zM({trace:e,seconds:n}){const[s,r]=N.useState(!1),i=sT(e)||`${e.length} ${e.length===1?"step":"steps"}`;return t.jsxs("div",{className:`lt-work ${s?"open":""}`,children:[t.jsxs("button",{className:"lt-wh",onClick:()=>r(!s),"aria-expanded":s,children:[t.jsx(i1,{size:14,"aria-hidden":"true"}),t.jsxs("span",{children:[n?t.jsxs("b",{children:["Worked for ",F1(n),": "]}):null,n&&!i.startsWith("squad-kit")?i[0].toLowerCase()+i.slice(1):i]}),t.jsx(Aa,{size:15,className:"chev","aria-hidden":"true"})]}),s&&t.jsx(O4,{trace:e})]})}function O4({trace:e,live:n}){return t.jsx("ul",{className:"lt-steps",children:e.map((s,r)=>t.jsxs("li",{className:s.kind==="refused"?"refused":"",children:[n&&r===e.length-1?t.jsx(Xe,{size:14,className:"spin","aria-hidden":"true"}):t.jsx(ce,{size:14,strokeWidth:2.4,"aria-hidden":"true"}),t.jsx(R,{text:s.text})]},`${s.at}-${r}`))})}function MM(e){const[n,s]=N.useState(Date.now);return N.useEffect(()=>{const r=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(r)},[]),Math.max(0,(n-Date.parse(e))/1e3)}function OM({c:e,turn:n}){const s=re(),r=MM(n.ask.at),i=n.trace[n.trace.length-1]?.text??"Reading what squad-kit already knows about the project";return t.jsxs("div",{className:"lt-think",role:"status","aria-live":"polite",children:[t.jsxs("div",{className:"lt-th",children:[t.jsx("span",{className:"live","aria-hidden":"true"}),t.jsx(R,{as:"b",className:"shim",text:i}),t.jsx("span",{className:"lt-since",children:F1(r)}),t.jsxs("button",{className:"btn sm",disabled:s.isPending,onClick:()=>s.mutate({path:`/api/v1/lead/conversations/${encodeURIComponent(e.id)}/stop`,done:"Stopped. What it found so far stays."}),children:[t.jsx(Jn,{size:11})," Stop"]})]}),n.trace.length>1&&t.jsx(O4,{trace:n.trace.slice(0,-1)})]})}function _4({head:e,body:n,said:s}){const r=Math.min(s.shown,s.head),i=Math.max(0,s.shown-s.head),a=!s.done;return t.jsxs(t.Fragment,{children:[r>0&&t.jsx(R,{as:"h3",text:Fd(e,r)}),n&&i>0&&t.jsx(Mr,{text:Fd(n,i),ticket:"",stream:a,caret:a})]})}function _M({answer:e,said:n}){const[s,r]=N.useState(null),i=e.evidence.map(u=>({src:Mt(u.url),caption:u.story?`${u.caption} (${u.story}'s proof)`:u.caption,story:u.story})),a=yw(e.headline,e.body),l=e.cards.filter(u=>u.kind==="open_story"),c=e.cards.filter(u=>u.kind!=="open_story");return n.done?t.jsxs("div",{className:"lt-answer",children:[t.jsx(R,{as:"h3",text:e.headline}),a&&t.jsx(Mr,{text:a,ticket:""}),(i.length>0||e.sources.length>0)&&t.jsxs("div",{className:"lt-evidence",children:[i.map((u,h)=>t.jsxs("button",{className:"lt-shot zoom",onClick:()=>r(h),"aria-label":`Open the picture full size: ${u.caption}`,children:[t.jsx("img",{src:u.src,alt:u.caption,loading:"lazy"}),u.story&&t.jsxs("span",{className:"from",children:["From ",u.story,"'s proof"]}),t.jsx(R,{className:"cap",text:e.evidence[h].caption})]},u.src)),e.sources.length>0&&t.jsxs("div",{className:"lt-src",children:[t.jsx("span",{className:"lbl2",children:"Sources"}),e.sources.map((u,h)=>t.jsx(DM,{s:u},`${u.kind}-${u.ref}-${h}`))]})]}),e.learned&&t.jsxs("p",{className:"lt-learned",children:[t.jsx("b",{children:"Saved in squad-kit's notes"})," for the next person: ",t.jsx(R,{text:e.learned})]}),l.length>0&&t.jsx("div",{className:"lt-opens",children:l.map(u=>t.jsx(z4,{card:u},u.id))}),c.length>0&&t.jsx("div",{className:"lt-cards",children:c.map((u,h)=>t.jsx("div",{className:"rise",style:{"--i":h},children:t.jsx(qM,{card:u})},u.id))}),s!==null&&t.jsx(zs,{pictures:i,start:s,onClose:()=>r(null)})]}):t.jsx("div",{className:"lt-answer",children:t.jsx(_4,{head:e.headline,body:a,said:n})})}function DM({s:e}){const n=hT(e),s=t.jsxs(t.Fragment,{children:[e.kind==="file"?t.jsx(Dr,{size:13,"aria-hidden":"true"}):null,t.jsx("span",{className:"k",children:e.kind==="file"?pT(e.ref):e.kind==="note"?"Notes":e.kind==="guide"?"Guide":e.kind==="log"?"Log":e.ref}),e.label&&t.jsx(R,{text:e.label})]}),r=e.kind==="file"?e.ref:e.kind==="note"?`Saved on ${e.ref}`:void 0;return n?n.to==="/board"?t.jsx(ge,{to:"/board",search:{ticket:n.ticket},className:"lt-ref",children:s}):n.to==="/architecture"?t.jsx(ge,{to:"/architecture",search:{adr:n.adr},className:"lt-ref",children:s}):t.jsx(ge,{to:"/releases",className:"lt-ref",children:s}):t.jsx("span",{className:"lt-ref",title:r,children:s})}function D4({pop:e,avatar:n,title:s,sub:r,busy:i,onExpand:a,children:l}){const[c,u]=N.useState(!1),h=()=>{if(window.matchMedia?.(Al).matches)return Nt.close(e.id);u(!0),setTimeout(()=>Nt.close(e.id),200)},m=p=>x=>{x.stopPropagation(),p()};return t.jsxs("section",{className:`pop ${e.min?"mini":""} ${c?"out":""}`,"aria-label":typeof s=="string"?s:r,children:[t.jsxs("header",{className:"ph",onClick:()=>e.min&&Nt.open(e.id),children:[n,t.jsxs("div",{className:"pt",children:[t.jsx("h2",{children:s}),t.jsxs("div",{className:"sub",children:[t.jsx("span",{className:`dot ${i?"busy":""}`,"aria-hidden":"true"}),t.jsx(R,{text:r})]})]}),t.jsxs("div",{className:"tools",children:[t.jsx("button",{className:"ib",onClick:m(a),"aria-label":"Open the full page",title:"Open the full page",children:t.jsx(el,{size:16})}),t.jsx("button",{className:"ib",onClick:m(()=>e.min?Nt.open(e.id):Nt.minimise(e.id)),"aria-label":e.min?"Open it again":"Minimise",title:e.min?"Open it again":"Minimise",children:t.jsx(Ra,{size:16})}),t.jsx("button",{className:"ib",onClick:m(h),"aria-label":"Close",title:"Close",children:t.jsx(Ue,{size:16})})]})]}),!e.min&&l]})}function BM({pop:e}){const n=bu(),s=xz(),r=E4(n.lead),i=n.lead?r.data:void 0,a=_u(),l=De(),c=_t(),u=zr({select:P=>P.location}),{send:h,busy:m}=P4(),[p,x]=N.useState(s.text),g=C1(i?.id??"new",xw(i)),{box:j,cancel:k,door:b}=aw(),S=(l.data?.ready?l.data.meta:void 0)?.project??"the project",T=l.data?.ready?l.data.tickets.length+l.data.stats.released30:0;N.useEffect(()=>x(s.text),[s.n,s.text]);const E=s.context??cT(u.pathname,u.search),z=(P,L=!1)=>h({text:P.trim(),context:i?null:E,conversation:i?.id??null,fresh:L},W=>{Nt.follow(W.id),dg.used(),x(""),g.toBottom()}),$=()=>{j?(j.send(p.trim()),x("")):z(p)};return t.jsxs(D4,{pop:e,avatar:t.jsx("span",{className:"av lead",children:t.jsx(Ma,{size:20})}),title:"Squad lead",sub:`${S} · knows the code${T?`, ${T} ${T===1?"story":"stories"}`:""}`,busy:!!i?.thinking,onExpand:()=>void c({to:"/lead",search:i?{c:i.id}:{}}),children:[t.jsx(Dd.Provider,{value:b,children:t.jsxs("div",{className:"feed",ref:i?g.boxRef:void 0,children:[t.jsx("div",{className:"feedcol",ref:i?g.contentRef:void 0,children:i?i.turns.map((P,L)=>t.jsx(M4,{c:i,turn:P,last:L===i.turns.length-1,onAgain:(W,F)=>{k(),z(W,F)}},P.n)):n.lead&&r.isLoading?null:t.jsx(WM,{view:a.data,onPick:x})}),i&&t.jsx($1,{s:g})]})}),t.jsxs("div",{className:"composer",children:[j&&t.jsx(T1,{box:j,onCancel:k}),t.jsx(R4,{value:p,onChange:x,onSend:$,busy:m||!!i?.thinking,placeholder:j?j.placeholder:i?"Ask a follow-up…":`Ask about ${S}, or ask for something…`,autoFocus:!0}),t.jsxs("div",{className:"where",children:[t.jsx(q4,{ctx:i?.context??E}),t.jsx("span",{children:"Enter to send"})]})]})]})}function WM({view:e,onPick:n}){const s=(gu().data?.apps??[]).map(c=>c.name),r=(e?.needsYou??[]).filter(c=>c.kind!=="slow"),i=Math.max(Ou(),r.length),a=e?.whatsNew??[],l=bw({apps:s,needsYou:e?.needsYou??[],squadNow:e?.squadNow??[]});return t.jsxs("div",{className:"empty",children:[r.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h6",{children:"Needs you"}),r.slice(0,4).map((c,u)=>t.jsxs("button",{className:"need",style:{"--i":u},onClick:()=>Nt.open(c.story),children:[t.jsxs("div",{children:[t.jsx(R,{as:"b",text:c.words}),t.jsx(R,{as:"small",text:c.more??c.title})]}),t.jsx("span",{className:"go",children:c.kind==="questions"||c.kind==="ask"?"Answer":"Open"})]},c.id)),i>Math.min(4,r.length)&&t.jsxs(ge,{to:"/inbox",className:"linkbtn",children:["and ",i-Math.min(4,r.length)," more in Waiting for you"]})]}),a.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h6",{children:"What's new"}),t.jsx("ul",{className:"news",children:a.slice(0,3).map(c=>t.jsx("li",{children:t.jsx(ge,{to:"/board",search:{ticket:c.story},children:t.jsx(R,{text:c.words})})},c.id))})]}),t.jsx("h6",{children:"Try asking"}),t.jsx("div",{className:"sugs",children:l.map(c=>t.jsx("button",{className:"sug",onClick:()=>n(c),children:c},c))})]})}function UM({pop:e,onOpenDoc:n}){const s=qa(e.id),r=s.data,i=s.error instanceof Error&&s.error.message.startsWith("404 ");N.useEffect(()=>{i&&Nt.close(e.id)},[i,e.id]);const a=_t(),l=r?N1(r):"analyst";return N.useEffect(()=>{!e.min&&r?.waitKey&&Nt.looked(e.id,r.waitKey)},[e.min,e.id,r?.waitKey]),t.jsx(D4,{pop:e,avatar:t.jsx("span",{className:`av av-${l}`,children:T4[l]}),title:t.jsxs(t.Fragment,{children:[ct[l]," ",t.jsx("span",{className:"mono",children:e.id})]}),sub:r?es(r.title):e.id,busy:!!r?.chat?.thinking,onExpand:()=>void a(r?.chat?{to:"/conversations",search:{ticket:e.id}}:{to:"/board",search:{ticket:e.id}}),children:t.jsx(zu,{id:e.id,size:"pop",onOpenDoc:n})})}function dk(){const e=bu(),n=bM(),s=p$(e,n),r=Ia(wu),i=rf(x$(),r),a=h$(s,i),l=zr({select:m=>m.location.pathname}),c=l.startsWith("/lead"),[u,h]=N.useState(null);return N.useEffect(()=>{const m=p=>{if(!(p.metaKey||p.ctrlKey)||p.altKey||p.shiftKey||p.key.toLowerCase()!=="k")return;p.preventDefault();const x=l.startsWith("/lead")?document.getElementById("lead-page-ask"):null;if(x)return x.focus();Nt.toggle("lead")};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[l]),t.jsxs("div",{className:`chatpops ${r?"phone":""} ${a.some(m=>!m.min)?"has-open":""}`,children:[t.jsx("div",{className:"pops",children:a.map(m=>m.id==="lead"?t.jsx(BM,{pop:m},"lead"):t.jsx(UM,{pop:m,onOpenDoc:h},m.id))}),u&&t.jsx(Iu,{doc:u,onClose:()=>h(null)}),t.jsx(CM,{s:e,here:n,noLead:c})]})}const B4=["app","usage-limit"];function W4(){return ve({queryKey:B4,queryFn:()=>ye("/api/v1/app/usage-limit"),refetchInterval:5e3})}function If(){const{data:e}=W4(),n=Ot(),{toast:s}=Le();if(!e?.pause||!e.text)return null;const r=async()=>{try{n.setQueryData(B4,await et("/api/v1/app/usage-limit/try-now","POST")),n.invalidateQueries(),s("The squad carries on now. If the limit is still there, it waits again by itself.")}catch(i){s(i instanceof Error?i.message:String(i),"err")}};return t.jsxs("section",{className:"upd failed",role:"status","aria-label":"The usage limit is reached",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(Zm,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsx("b",{className:"upd-title",children:e.text}),t.jsxs("span",{className:"upd-sub",children:["Every project waits, because they share one ",e.pause.name," account. Nothing is lost, and the wait does not count as a failed try.",e.pause.resetsAt?"":" squad-kit looks again every 10 minutes."]})]}),t.jsxs("div",{className:"upd-acts",children:[t.jsx("button",{className:"btn sm",onClick:()=>void r(),children:"Try now"}),t.jsx(X,{text:"squad try-now"})]})]})}function Ff(){const{data:e}=ve({queryKey:["app","save-trouble"],queryFn:()=>ye("/api/v1/app/save-trouble"),refetchInterval:5e3});return e?.text?t.jsxs("section",{className:"upd failed",role:"alert","aria-label":"squad-kit cannot save its work",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(nS,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsx("b",{className:"upd-title",children:e.text}),t.jsxs("span",{className:"upd-sub",children:["The squad waits meanwhile. ",e.projects.length>1?`${e.projects.length} projects wait.`:""]}),e.detail&&t.jsxs("details",{children:[t.jsx("summary",{className:"note",children:"For engineers"}),t.jsx("span",{className:"mono",style:{fontSize:12.5,whiteSpace:"pre-wrap"},children:e.detail})]})]})]}):null}function U4(e){return ve({queryKey:["happened",e.id],queryFn:()=>ye(`/api/v1/tickets/${e.id}/happened`),refetchInterval:e.live?5e3:15e3})}function Du(e){const n=Math.max(0,Math.round(e));if(n<60)return`${Math.max(1,n)} s`;if(n<600)return n%60?`${Math.floor(n/60)} min ${n%60} s`:`${n/60} min`;if(n<3600)return`${Math.round(n/60)} min`;const s=Math.round(n%3600/60);return s?`${Math.floor(n/3600)} h ${s} min`:`${Math.floor(n/3600)} h`}function HM({t:e,onTab:n,onLog:s}){const r=U4(e);return r.data?r.data.steps.length?t.jsxs("div",{className:"happened",children:[r.data.steps.map((i,a)=>t.jsx(KM,{s:i,t:e,onTab:n,onLog:s},`${i.step}-${i.from??i.to??a}`)),t.jsx("p",{className:"note happened-foot",children:"Engineers: Full log shows every action the agents took, with commands, file changes and their exact words, and how to open each session in a terminal."})]}):t.jsx("p",{className:"note",children:"Nothing has happened yet. The first card comes when the first step ends, for example the Analyst's questions."}):t.jsx("p",{className:"note",children:r.isError?"Could not read what happened. It tries again by itself.":"Loading…"})}function KM({s:e,t:n,onTab:s,onLog:r}){const i=e.seconds!==void 0?Du(e.seconds):"",a=[e.running?`now${i?` · ${i}`:""}`:i,...e.notes].filter(Boolean).join(" · ");return t.jsxs("article",{className:`hstep ${e.running?"now":""}`,"aria-label":e.name,children:[t.jsxs("div",{className:"hhd",children:[e.running?t.jsx("span",{className:"hring","aria-label":"Working now"}):t.jsx("span",{className:"hok","aria-label":"Done",children:t.jsx(ce,{size:11,strokeWidth:3})}),t.jsx("b",{children:e.name}),a&&t.jsx("span",{children:a}),t.jsx("span",{className:"grow"}),e.to&&!e.running&&t.jsx("span",{className:"hat",children:tn(e.to)})]}),t.jsx(R,{as:"p",className:"hsum",text:e.summary}),e.handedIn&&t.jsx(YM,{h:e.handedIn,tab:e.tab,onTab:s,ticket:n}),e.session&&(e.actions??0)>0&&t.jsxs("button",{className:"linkbtn hmore",onClick:()=>r(e.session),children:["What it looked at and said (",e.actions," ",e.actions===1?"action":"actions",")"]}),e.skipped?t.jsxs("div",{className:"hskip",children:[t.jsx(Ra,{size:12})," Skipped ",e.skipped===1?"one action":`${e.skipped} actions`," this step may not take (by design, nothing went wrong)"]}):null]})}const VM={plan:"Open it in Plan",changes:"See the changes",proof:"Open it in Proof"};function Tg(e,n=3){const[s,r]=N.useState(!1),i=e.length-n;return{shown:s?e:e.slice(0,n),more:i>0?t.jsx("button",{className:"linkbtn",onClick:()=>r(!s),children:s?"Show less":`+${i} more`}):null}}function YM({h:e,tab:n,onTab:s,ticket:r}){if(e.kind==="verdict")return t.jsx("div",{className:"hverdict",children:t.jsx(uk,{h:e,ticket:r})});const i=n&&s?t.jsx("button",{className:"linkbtn",onClick:()=>s(n),children:e.kind==="checks"?"See them in Proof":VM[n]}):null;return t.jsxs("div",{className:"hgot",children:[t.jsx("b",{children:"Handed in"}),t.jsx(uk,{h:e,ticket:r}),i&&t.jsx("div",{className:"hlink",children:i})]})}function uk({h:e,ticket:n}){switch(e.kind){case"questions":return t.jsx(GM,{items:e.items});case"spec":return t.jsx(QM,{story:e.story,criteria:e.criteria});case"design":return t.jsx(ZM,{h:e});case"files":return t.jsx(XM,{h:e});case"checks":return t.jsxs("span",{children:[t.jsx("span",{className:`pill ${e.ok?"ok":"bug"}`,children:e.ok?"Pass":"Failed"})," ",t.jsx(R,{text:e.text})]});case"verdict":return t.jsxs("span",{children:[t.jsx("span",{className:`pill ${e.approved?"ok":"you"}`,children:e.approved?"Approved":"Asked for fixes"}),e.notes.length>0&&t.jsx("ul",{className:"hlist",children:e.notes.map((s,r)=>t.jsx(R,{as:"li",text:s},r))})]});case"shots":return t.jsx(JM,{shots:e.shots,ticket:n})}}function GM({items:e}){const{shown:n,more:s}=Tg(e);return t.jsxs(t.Fragment,{children:[t.jsx("ol",{className:"hlist",children:n.map((r,i)=>t.jsxs("li",{...ze(r.text),children:[t.jsx(R,{text:r.text}),r.answer&&t.jsx(R,{className:"hans",lead:"You:",text:r.answer})]},i))}),s]})}function QM({story:e,criteria:n}){const{shown:s,more:r}=Tg(n);return t.jsxs(t.Fragment,{children:[e&&t.jsx(R,{as:"p",className:"hstory",text:e}),n.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"hsub",children:"Done when"}),t.jsx("ul",{className:"hlist",children:s.map((i,a)=>t.jsx(R,{as:"li",text:i},a))}),r]})]})}function ZM({h:e}){const{shown:n,more:s}=Tg(e.steps),r=[e.mockup?"With a mockup":"",e.follows.length?`Follows ${e.follows.join(", ")}`:"",e.adr?`Saved as ${e.adr}`:""].filter(Boolean);return t.jsxs(t.Fragment,{children:[e.title&&t.jsxs("p",{className:"hstory",...ze(e.title),children:[t.jsx(R,{as:"b",text:e.title}),e.chosen?t.jsx(R,{text:`: ${e.chosen}`}):""]}),e.steps.length>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"hsub",children:[e.steps.length," ",e.steps.length===1?"step":"steps"," to build"]}),t.jsx("ol",{className:"hlist",children:n.map((i,a)=>t.jsx(R,{as:"li",text:i},a))}),s]}),r.length>0&&t.jsx("span",{className:"hsub",children:r.join(" · ")})]})}function XM({h:e}){const n=[["New",e.added],["Changed",e.changed],["Removed",e.removed]].filter(([,s])=>s.length);return n.length?t.jsx("span",{className:"hfiles",children:n.map(([s,r])=>t.jsxs("span",{children:[s,": ",t.jsx("span",{className:"mono",children:r.slice(0,8).join(", ")}),r.length>8?` and ${r.length-8} more`:""]},s))}):t.jsx("ol",{className:"hlist",children:e.steps.map((s,r)=>t.jsx(R,{as:"li",text:s},r))})}function JM({shots:e,ticket:n}){const[s,r]=N.useState(null),i=e.map(a=>({src:Mt(`/api/v1/proof/${a.file}`),caption:a.criterion}));return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"hshots",children:i.map((a,l)=>t.jsxs("button",{className:"zoom",onClick:()=>r(l),"aria-label":`Open the screenshot for ${a.caption} full size`,children:[t.jsx("img",{src:a.src,alt:`${n.id}: ${a.caption}`,loading:"lazy"}),t.jsx(R,{as:"small",text:a.caption})]},a.src))}),s!==null&&t.jsx(zs,{pictures:i,start:s,onClose:()=>r(null)})]})}const eO={questions:"Questions",spec:"Spec",scan:"Reading the project",design:"Design",blueprint:"Stack and patterns",build:"Build",fix:"Fixes",review:"Review",proof:"Proof",chat:"Talking it through",draft:"Filling in a new ticket"},tO=["analyst","architect","builder","reviewer","tester"];function Eg(e){return e?.payment==="api-key"?"What the work cost on your API key, at its prices.":`What the work would cost at API prices. Your ${e?.name??"AI"} plan covers it, so this is a value, not a bill.`}function H4(e,n){e.runs+=n.runs;for(const s of["inputTokens","cachedTokens","outputTokens","costUsd"])n[s]!==void 0&&(e[s]=(e[s]??0)+n[s]);n.tokensUnknown&&(e.tokensUnknown=(e.tokensUnknown??0)+n.tokensUnknown),n.costUnknown&&(e.costUnknown=(e.costUnknown??0)+n.costUnknown)}function Ag(e){const n={runs:0};for(const s of e)H4(n,s);return n}function K4(e){return tO.flatMap(n=>{const s=e.filter(i=>i.role===n);if(!s.length)return[];const r=[];for(const i of s){let a=r.find(l=>l.level===i.level&&l.model===i.model);a||r.push(a={level:i.level,model:i.model,steps:[],total:{runs:0}}),a.steps.includes(i.step)||a.steps.push(i.step),H4(a.total,i)}return[{role:n,total:Ag(s),levels:r}]})}function Sa(e){return e.costUsd===void 0?null:e.costUsd<.005?"under $0.01":`$${e.costUsd.toFixed(2)}`}function id(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}const Lf=e=>`${e} ${e===1?"run":"runs"}`;function hk({t:e}){const n=Sa(e);return n?t.jsxs("span",{title:e.costUnknown?`${Lf(e.costUnknown)} did not report a cost, so the real amount is higher`:void 0,children:[n,e.costUnknown?t.jsxs("span",{className:"note",children:[" +",e.costUnknown," not reported"]}):null]}):t.jsx("span",{className:"note",children:"Not reported"})}function pk({t:e}){if(e.inputTokens===void 0&&e.outputTokens===void 0)return t.jsx("span",{className:"note",children:"Not reported"});const n=e.cachedTokens?`, ${id(e.cachedTokens)} of it read again from earlier in the conversation, which costs less`:"";return t.jsxs("span",{title:`Tokens are the pieces of text the AI reads and writes. It read ${id(e.inputTokens??0)}${n}.`,children:[e.inputTokens!==void 0&&t.jsxs(t.Fragment,{children:[id(e.inputTokens)," read"]}),e.inputTokens!==void 0&&e.outputTokens!==void 0&&" · ",e.outputTokens!==void 0&&t.jsxs(t.Fragment,{children:[id(e.outputTokens)," written"]})]})}function nO({level:e,model:n}){return n?t.jsxs(t.Fragment,{children:[n," ",t.jsx("span",{className:"note",children:e})]}):t.jsx(t.Fragment,{children:e})}function Pg({roles:e,total:n,steps:s}){return t.jsxs("table",{className:"table usage",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Role"}),t.jsx("th",{children:"Model level"}),t.jsx("th",{children:s?"What it did":"Runs"}),t.jsx("th",{children:"Tokens"}),t.jsx("th",{className:"num",children:"Cost"})]})}),t.jsx("tbody",{children:e.flatMap(r=>r.levels.map((i,a)=>t.jsxs("tr",{children:[t.jsx("td",{children:a===0&&t.jsxs("span",{className:"who",children:[t.jsx(Ni,{role:r.role,small:!0})," ",Zs[r.role]]})}),t.jsx("td",{children:t.jsx(nO,{level:i.level,model:i.model})}),t.jsx("td",{children:s?t.jsxs(t.Fragment,{children:[i.steps.map(l=>eO[l]??l).join(", "),t.jsxs("span",{className:"note",children:[" · ",Lf(i.total.runs)]})]}):i.total.runs}),t.jsx("td",{children:t.jsx(pk,{t:i.total})}),t.jsx("td",{className:"num",children:t.jsx(hk,{t:i.total})})]},`${r.role}-${i.level}-${i.model}`)))}),t.jsx("tfoot",{children:t.jsxs("tr",{children:[t.jsx("td",{children:"Total"}),t.jsx("td",{}),t.jsx("td",{children:s?t.jsx("span",{className:"note",children:Lf(n.runs)}):n.runs}),t.jsx("td",{children:t.jsx(pk,{t:n})}),t.jsx("td",{className:"num",children:t.jsx(hk,{t:n})})]})})]})}function Oa(){return ve({queryKey:["cost"],queryFn:()=>ye("/api/v1/cost"),refetchInterval:1e4})}function sO({t:e}){const n=Oa().data?.payment,s=e.usage??[],r=Ag(s),i=Sa(r);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["What it used",s.length>0&&t.jsx("span",{className:"pill",children:i?n?.payment==="api-key"?`${i} on your API key`:`Included in your plan · ${i} value`:"Cost not reported"})]}),s.length?t.jsxs(t.Fragment,{children:[t.jsx(Pg,{roles:K4(s),total:r,steps:!0}),t.jsxs("p",{className:"note",style:{marginTop:8},children:[Eg(n)," Each role's model level can be changed on the Harness page, under Agents."]})]}):t.jsx("p",{className:"note",children:"Nothing yet. Each run of a role is counted here as the squad works."})]})}function V4(){return ve({queryKey:["usage"],queryFn:()=>ye("/api/v1/usage"),refetchInterval:5e3})}function rO(){const e=V4().data?.total,n=Oa().data?.payment;return e?.runs?t.jsx("span",{title:Eg(n),children:n?.payment==="api-key"?t.jsxs(t.Fragment,{children:["Used ",t.jsx("b",{children:Sa(e)??"an unknown amount"})," on your API key"]}):t.jsxs(t.Fragment,{children:[t.jsx("b",{children:Sa(e)??"An unknown amount"})," of AI work, included in your plan"]})}):null}function iO(){const e=V4().data,n=Oa().data?.payment;return e?.total.runs?t.jsxs(t.Fragment,{children:[t.jsx("h2",{style:{marginTop:30},children:"What the squad used"}),t.jsxs("p",{className:"note",style:{marginTop:2},children:["Every ticket on this computer (",e.tickets," so far) and the project's own work, like reading the project and filling in new tickets",e.project.runs?` (${Sa(e.project)??"cost not reported"})`:"",e.deleted?.tickets?`, and ${e.deleted.tickets} deleted ${e.deleted.tickets===1?"ticket":"tickets"} (${Sa(e.deleted.total)??"cost not reported"})`:"",". ",Eg(n)," Change a role's model level with its Edit button above."]}),t.jsx("div",{style:{marginTop:10},children:t.jsx(Pg,{roles:e.roles,total:e.total})})]}):null}const hs=e=>e<.005?"under $0.01":`$${e.toFixed(2)}`,pl=e=>e>0&&e<.01?"under 1%":`${Math.round(e*100)}%`;function aO({t:e}){const n=ve({queryKey:["cost",e.id],queryFn:()=>ye(`/api/v1/tickets/${e.id}/cost`),refetchInterval:e.live?5e3:2e4}),s=n.data;return s?s.total.runs?t.jsxs("div",{className:"costs",children:[t.jsx(mk,{c:s}),t.jsxs("section",{className:"costcard",children:[t.jsx("h3",{children:"Size of the work"}),s.size?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"sizes",role:"img","aria-label":`Size: ${s.size.size}`,children:["small","medium","large"].map(r=>t.jsx("span",{className:r===s.size.size?"on":"",children:r[0].toUpperCase()+r.slice(1)},r))}),t.jsxs("p",{children:[s.size.words," ",s.why]})]}):t.jsxs("p",{children:["This is one of the first tickets in ",s.project,", so there is no usual size to compare with yet. It shows once two tickets are accepted.",s.why?` ${s.why}`:""]}),s.seconds!==void 0&&t.jsxs("p",{className:"note",children:["The squad worked on it for ",Du(s.seconds),", not counting the time it waited for you."]})]}),s.where.parts.length>0&&t.jsxs("section",{className:"costcard",children:[t.jsx("h3",{children:"Where the work went"}),t.jsx("div",{className:"wbars",children:s.where.parts.map(r=>t.jsxs("div",{className:"wbar",children:[t.jsx("span",{children:r.name}),t.jsxs("span",{className:"wbarline",children:[t.jsx("i",{style:{width:`${Math.max(2,Math.round(r.share*100))}%`}}),t.jsxs("small",{children:[pl(r.share),s.payment.payment==="api-key"&&r.costUsd!==void 0?` · ${hs(r.costUsd)}`:""]})]})]},r.name))}),t.jsxs("p",{className:"note",children:[s.where.by==="tokens"?"By the amount of text the AI read and wrote, because some steps did not report a cost. ":"","Thinking steps use the strongest model on purpose: a mistake there costs the most to fix later."]})]}),s.payment.payment==="subscription"?t.jsxs("section",{className:"costcard",children:[t.jsx("h3",{children:"Value of the AI work"}),t.jsxs("p",{children:[s.total.costUsd!==void 0?t.jsxs(t.Fragment,{children:[t.jsx("b",{className:"bigusd",children:hs(s.total.costUsd)})," at API prices, covered by your plan."]}):"The AI tool did not report what this work is worth."," ","This month the squad did ",t.jsx("b",{children:hs(s.month.total.costUsd??0)})," of AI work for ",s.project,"."]}),t.jsxs("p",{className:"note",children:["This is a value, not a bill: what the same work would cost if you paid per use.",s.total.costUnknown?` ${s.total.costUnknown} of its steps did not report one.`:""]})]}):null,s.tip&&t.jsxs("section",{className:"costcard tip",children:[t.jsx("h3",{children:"Small change next time?"}),t.jsxs("p",{children:[s.tip,s.payment.payment==="subscription"?" If your plan's usage limit is reached, squad-kit pauses and carries on by itself when it resets.":""]})]}),t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"Details for engineers"}),t.jsxs("p",{className:"note",children:[s.details.models,s.details.tokens?`. ${s.details.tokens}.`:"."]}),t.jsx(Pg,{roles:K4(e.usage??[]),total:Ag(e.usage??[]),steps:!0}),t.jsx("div",{style:{marginTop:8},children:t.jsx(X,{text:`squad cost ${e.id}`})})]})]}):t.jsxs("div",{className:"costs",children:[t.jsx(mk,{c:s}),t.jsx("p",{className:"note",children:"Nothing used yet. Each step the squad takes is counted here."})]}):t.jsx("p",{className:"note",children:n.isError?"Could not read the cost. It tries again by itself.":"Loading…"})}function mk({c:e}){if(e.payment.payment==="subscription")return t.jsxs("section",{className:"costcard paid",children:[t.jsxs("div",{className:"paidhead",children:[t.jsx("span",{className:"paidic",children:t.jsx(ce,{size:15,strokeWidth:2.6})}),t.jsxs("b",{children:["Included in your ",e.payment.name," plan. No extra charge."]})]}),t.jsxs("p",{className:"muted",children:["You pay for ",e.payment.name," with a subscription, so this ticket cost you nothing extra."," ",e.payment.from==="guess"&&"squad-kit could not tell how you pay, so it shows it this way. ",t.jsx(ge,{to:"/settings",children:"Pay with an API key instead?"})]})]});const n=e.budget;return t.jsxs("section",{className:`costcard ${n?.over.length?"over":n?.warn.length?"warn":""}`,children:[t.jsxs("div",{className:"paidhead",children:[t.jsx("span",{className:"paidic money",children:t.jsx(ab,{size:15})}),t.jsxs("b",{children:[e.total.runs?e.total.costUsd!==void 0?hs(e.total.costUsd):"Not reported":"$0.00"," on your API key",e.total.costUnknown?t.jsxs("span",{className:"note",children:[" + ",e.total.costUnknown," steps not reported"]}):null]})]}),t.jsxs("p",{className:"muted",children:["Real money: each step is paid per use",e.payment.found?.kind==="api-key"?`, on your ${e.payment.found.label}`:"",". ",t.jsx(ge,{to:"/settings",children:"Pay with a subscription instead?"})]}),n&&t.jsx(oO,{b:n,project:e.project})]})}function fk({share:e}){return t.jsx("span",{className:`meter ${e>=1?"over":e>=.8?"warn":""}`,role:"img","aria-label":pl(e),children:t.jsx("i",{style:{width:`${Math.min(100,Math.round(e*100))}%`}})})}function oO({b:e,project:n}){return!e.ticketUsd&&!e.monthUsd?t.jsxs("p",{className:"note",children:["This month: ",hs(e.monthSpent)," for ",n,". No budget yet: ",t.jsx(ge,{to:"/settings",children:"set one per ticket and per month"}),", and squad-kit warns you at 80%."]}):t.jsxs("div",{className:"budgets",children:[e.ticketUsd&&e.ticketShare!==void 0&&t.jsxs("div",{className:"budgetrow",children:[t.jsxs("span",{children:[pl(e.ticketShare)," of this ticket's ",hs(e.ticketUsd)," budget"]}),t.jsx(fk,{share:e.ticketShare})]}),e.monthUsd&&e.monthShare!==void 0&&t.jsxs("div",{className:"budgetrow",children:[t.jsxs("span",{children:["This month: ",hs(e.monthSpent)," of your ",hs(e.monthUsd)," for ",n]}),t.jsx(fk,{share:e.monthShare})]}),[...e.over,...e.warn].map(s=>t.jsxs("p",{className:"budgetsay",children:[t.jsx(Is,{size:14}),e.over.includes(s)?s==="ticket"?"Over its budget. Before its next step the ticket waits for you: carry on, do the rest yourself, or make the plan smaller. No step is cut in half.":"Over this month's budget. Each ticket waits for you before its next step. No step is cut in half.":s==="ticket"?"At 80% of its budget. At 100% the ticket waits for you before its next step.":"At 80% of this month's budget. At 100% tickets wait for you before their next step."]},s))]})}function lO(){const e=Oa().data,[n,s]=N.useState(()=>{try{return JSON.parse(sessionStorage.getItem("squad-budget-hidden")??"[]")}catch{return[]}});if(N.useEffect(()=>{try{sessionStorage.setItem("squad-budget-hidden",JSON.stringify(n))}catch{}},[n]),!e||e.payment.payment!=="api-key")return null;const r=c=>`${c.kind}:${c.id??e.month.month}:${c.over?"over":"warn"}`,i=e.warnings.filter(c=>!n.includes(r(c)));if(!i.length)return null;const a=i[0],l=c=>c.kind==="month"?`This month the squad used ${pl(c.share)} of your ${hs(c.limit)} budget for ${e.project}${c.over?". Tickets wait for you before their next step":""}`:`${c.id} ${c.title} used ${pl(c.share)} of its ${hs(c.limit)} budget${c.over?". It waits for you before its next step":""}`;return t.jsxs("section",{className:"upd failed budgetbar",role:"status","aria-label":"Budget",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(ab,{size:16})}),t.jsxs("div",{className:"upd-main",children:[t.jsx(R,{as:"b",className:"upd-title",text:l(a)}),t.jsxs("span",{className:"upd-sub",children:[i.length>1?`And ${i.length-1} more near a budget. `:"","At 100% a ticket waits for you between two steps, never in the middle of one."]})]}),t.jsxs("div",{className:"upd-acts",children:[a.id&&t.jsxs(ge,{to:"/board",search:{ticket:a.id},className:"btn sm",children:["Open ",a.id]}),t.jsx(ge,{to:"/settings",className:"btn sm",children:"Budgets"}),t.jsx("button",{className:"iconbtn","aria-label":"Hide this notice",onClick:()=>s([...n,...i.map(r)]),children:t.jsx(Ue,{size:14})})]})]})}function cO(){const e=Oa().data,n=re(),[s,r]=N.useState(""),[i,a]=N.useState(""),l=e?.budget;if(N.useEffect(()=>{r(l?.ticketUsd?String(l.ticketUsd):""),a(l?.monthUsd?String(l.monthUsd):"")},[l?.ticketUsd,l?.monthUsd]),!e)return null;const c=e.payment,u=(m,p)=>n.mutate({path:"/api/v1/cost/payment",method:"PUT",body:{payment:m},done:p}),h=c.found?`${c.tool} is signed in with ${c.found.label}${c.found.kind==="subscription"?", a subscription":", paid per use"}.`:`squad-kit could not tell how ${c.tool} is paid.`;return t.jsxs("div",{style:{margin:"22px 0 26px"},children:[t.jsx("h2",{children:"How you pay for the AI"}),t.jsxs("p",{className:"note",style:{margin:"2px 0 10px"},children:[h," ",c.from==="you"?"You chose below, and your choice wins.":"Change it below if that is not right."," It decides what the Cost tab shows."]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"You pay with"}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:`btn sm ${c.payment==="subscription"&&c.from==="you"?"pri":""}`,"aria-pressed":c.payment==="subscription"&&c.from==="you",onClick:()=>u("subscription","A subscription: the Cost tab shows the value of the work, with no extra charge"),children:"A subscription"}),t.jsx("button",{className:`btn sm ${c.payment==="api-key"&&c.from==="you"?"pri":""}`,"aria-pressed":c.payment==="api-key"&&c.from==="you",onClick:()=>u("api-key","An API key: the Cost tab shows real dollars and budgets"),children:"An API key"}),t.jsx("button",{className:`btn sm ${c.from!=="you"?"pri":""}`,"aria-pressed":c.from!=="you",onClick:()=>u("auto","squad-kit finds out how you pay"),children:"Find out for me"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad config set payment ${c.from==="you"?c.payment:"auto"}`})]})]}),c.payment==="api-key"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Budget per ticket"}),t.jsxs("span",{className:"moneyin",children:["$",t.jsx("input",{className:"input",inputMode:"decimal",value:s,placeholder:"No budget",onChange:m=>r(m.target.value),"aria-label":"Budget per ticket, in US dollars"})]})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Budget per month"}),t.jsxs("span",{className:"moneyin",children:["$",t.jsx("input",{className:"input",inputMode:"decimal",value:i,placeholder:"No budget",onChange:m=>a(m.target.value),"aria-label":"Budget per month, in US dollars"}),t.jsxs("span",{className:"note",children:["for ",e.project,", on this computer"]})]})]}),t.jsxs("div",{style:{marginTop:10,display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:"btn pri sm",disabled:n.isPending,onClick:()=>n.mutate({path:"/api/v1/cost/budget",method:"PUT",body:{ticketUsd:s.trim()||null,monthUsd:i.trim()||null},done:"Budgets saved"}),children:"Save budgets"}),t.jsx("span",{className:"note",children:"At 80% the ticket and the board say so. At 100% the ticket waits for you between two steps, never in the middle of one."}),t.jsx(X,{text:`squad config set budget --ticket ${s.trim()||"off"} --month ${i.trim()||"off"}`})]})]})]})}const dO={best:"Best",balanced:"Balanced",thrifty:"Thrifty"};function uO(){const e=Oa().data;if(!e)return null;const n=e.quality.some(s=>s.tickets>0);return t.jsxs("div",{className:"maprow",children:[t.jsxs("b",{style:{paddingTop:2},children:["On ",e.project]}),t.jsxs("span",{className:"qstats",children:[!n&&t.jsxs("span",{className:"note",children:["Each Quality setting's average cost and time per accepted ticket shows here once ",e.qualityAfter," tickets are accepted with it."]}),n&&e.quality.map(s=>t.jsxs("span",{className:"qstat",children:[t.jsx("b",{children:dO[s.quality]}),s.tickets>=e.qualityAfter?t.jsxs("span",{children:[s.costUsd!==void 0?`${hs(s.costUsd)} ${e.payment.payment==="api-key"?"":"of AI work "}`:"",s.seconds!==void 0?`${s.costUsd!==void 0?"and ":""}${Du(s.seconds)} of squad time `:"","per accepted ticket ",t.jsxs("span",{className:"note",children:["(",s.tickets," tickets)"]})]}):t.jsxs("span",{className:"note",children:["Shows after ",e.qualityAfter," accepted tickets (",s.tickets," so far)"]})]},s.quality)),n&&e.payment.payment==="subscription"&&t.jsx("span",{className:"note",children:"Values at API prices, covered by your plan."})]})]})}function Y4(e){try{return new Intl.DisplayNames(["en"],{type:"language"}).of(e)??e}catch{return e}}function G4({languages:e,value:n,onChange:s}){return e.length<2?null:t.jsx("select",{className:"input sm phone-lang","aria-label":"The language to open the app in",value:n,onChange:r=>s(r.target.value),children:e.map(r=>t.jsx("option",{value:r,children:Y4(r)},r))})}function zf({phone:e,starting:n}){const s=e.run;return n?t.jsxs("p",{className:"app-more phone-line",role:"status",children:[t.jsx(Xe,{size:13,className:"spin","aria-hidden":"true"})," ",s?.line??`Getting the app onto squad-kit's ${e.word}`]}):s?.state==="running"?t.jsxs("p",{className:"app-more phone-line",children:[t.jsx(yS,{size:13,"aria-hidden":"true"})," Open on ",s.device??`the ${e.word}`,s.language&&s.language!=="en"?`, in ${Y4(s.language)}`:"",". Close its window when you are done."]}):s?.ended?t.jsx("p",{className:"app-more",children:s.ended}):null}function Q4({phone:e}){return e.ready||!e.why?null:t.jsxs("p",{className:"app-more phone-wait",children:[e.why," ",e.web?"Start opens the web version meanwhile. ":"",t.jsx(ge,{to:"/tools",hash:(e.link??"/tools").split("#")[1]??"",children:"See what's needed"})]})}function hO(){const e=gu(),n=e.data?.apps??[];if(!n.length)return null;const s=n.some(r=>(r.start||r.phone?.ready)&&(r.state==="not-running"||r.state==="stopped")&&!r.up&&!r.fresh);return t.jsxs("div",{className:"apps",children:[t.jsx("div",{className:"apps-h",children:"Your apps"}),n.map(r=>t.jsx(xO,{a:r,together:n.filter(i=>i.start&&i.fresh&&i.fresh.id===r.fresh?.id),named:n.length>1,live:e.data?.live??!1,reading:e.data?.reading??!1,readError:e.data?.readError},r.repo)),s&&t.jsx("p",{className:"apps-note",children:"Starts the newest code, with every ticket you approved. No terminal needed."})]})}const pO=e=>(e??"").replace(/^https?:\/\//,"");function mO(e){const n=e.map(s=>`${s.id} ${s.title}`);return n.length>1?`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`:n[0]??""}function gk(e){switch(e.state){case"running":return e.phone?.run?.state==="running"?`On ${e.phone.run.device??`the ${e.phone.word}`}`:gO(e.since);case"starting":return"Starting…";case"stopped":return"Stopped";case"failed":return"Failed";default:return"Not running"}}function fO(e){return e.step==="phone"?e.phone?.run?.line??`Getting the app onto squad-kit's ${e.phone?.word??"phone"}`:e.step==="copy"?"Making a copy of the code. On a big project this takes a while.":e.step==="setup"?"Setting it up first":e.step==="start"?"Starting it":`Getting the newest ${e.base}`}function gO(e){const n=e?Math.round((Date.now()-Date.parse(e))/6e4):0;return n<1?"Running":`Running for ${n} min`}function xO({a:e,together:n,named:s,live:r,reading:i,readError:a}){const l=re(),c=De(),u=c.data?.ready?!!c.data.self:!1,[h,m]=N.useState(!1),[p,x]=N.useState(!1),g=s?` ${Ci(e.name)}`:"",j=(F,U,I)=>l.mutate({path:`/api/v1/apps/${encodeURIComponent(e.name)}/${F}`,body:I,done:U}),k=F=>j("start",`Starting ${e.name}`,F),b=e.phone,[w,S]=N.useState(b?.languages[0]??"en"),T=!!(e.start||b?.ready),E=b?.ready&&b.languages.length>1&&w!=="en"?` --lang ${w}`:"",z=()=>k(b?.ready?{phone:!0,...b.languages.length>1?{language:w}:{}}:b?{web:!0}:void 0),$=()=>j("start",`Starting the web version of ${e.name}`,{web:!0}),P=!!(b?.on||b?.run?.state==="running"),L=e.state==="failed"?e.busy:void 0,W=async(F,U,I)=>{try{for(const[D,M]of n.entries())await l.mutateAsync({path:`/api/v1/apps/${encodeURIComponent(M.name)}/${F}`,body:I,...D===n.length-1?{done:U}:{}})}catch{}};return t.jsxs("div",{className:`app-item ${e.state}`,children:[e.fresh&&e.start&&n[0]===e&&t.jsxs("div",{className:"app-new",role:"status",children:[t.jsxs("div",{className:"hd",children:[t.jsx("span",{className:"ok",children:t.jsx(ce,{size:13,strokeWidth:3})}),t.jsxs("b",{title:e.fresh.title,children:[e.fresh.id," is in the newest version"]})]}),t.jsx("p",{children:"Try the new version yourself."}),t.jsxs("div",{className:"app-acts",children:[t.jsx("button",{className:"btn sm go",disabled:l.isPending,onClick:()=>void W("restart",n.length>1?"Starting the new version":`Starting the new version of ${e.name}`),children:"Run the new version"}),t.jsx("button",{className:"btn sm",disabled:l.isPending,onClick:()=>void W("not-now","Fine. It stays as it is.",{ticket:e.fresh.id}),children:"Not now"})]}),u?t.jsx("small",{children:"It goes on as a pull request: its story says how to send it."}):e.fresh.release&&t.jsxs("small",{children:["It also goes out in release ",e.fresh.release,"."]}),t.jsx(X,{text:`squad app restart${g}`})]}),t.jsxs("div",{className:"app-row",children:[t.jsx("i",{"aria-hidden":"true"}),t.jsxs("span",{className:"nm",children:[t.jsx("b",{children:e.name}),t.jsx("small",{title:e.state==="running"?`Running at ${e.address}`:gk(e),children:gk(e)})]}),e.state==="running"&&!P?t.jsx("a",{className:"btn sm pri",href:e.address,target:"_blank",rel:"noreferrer",title:`Open ${e.address}`,children:"Open"}):e.state==="running"?null:e.state==="starting"?t.jsx("button",{className:"btn sm",disabled:l.isPending,onClick:()=>j("stop",`Stopped ${e.name}`),children:"Stop"}):T?t.jsx("button",{className:"btn sm go",disabled:l.isPending,onClick:z,children:e.state==="failed"?"Try again":"Start"}):null]}),t.jsx(yO,{a:e}),e.state==="starting"&&(b&&P?t.jsx(zf,{phone:b,starting:!0}):t.jsx("p",{className:"app-more",children:fO(e)})),b&&e.state!=="starting"&&t.jsx(zf,{phone:b,starting:!1}),b&&e.state!=="running"&&e.state!=="starting"&&t.jsx(Q4,{phone:b}),b?.ready&&e.state!=="running"&&e.state!=="starting"&&t.jsxs("p",{className:"app-more phone-pick",children:["Opens on squad-kit's ",b.word,b.languages.length>1?", in":".",t.jsx(G4,{languages:b.languages,value:w,onChange:S})]}),b?.web&&P&&(e.state==="starting"||e.state==="running")&&t.jsxs("div",{className:"app-acts",children:[t.jsx("button",{className:"btn sm",disabled:l.isPending,onClick:$,children:"Use the web version now"}),t.jsx(X,{text:`squad app start${g} --web`})]}),e.state==="running"&&t.jsxs("div",{className:"app-more",children:[!P&&t.jsx("span",{className:"addr",children:pO(e.address)}),e.includes.length>0&&t.jsx(R,{lead:"Includes",text:mO(e.includes)}),e.elsewhere&&t.jsx("span",{children:"Started outside the board, from a terminal or an earlier squad-kit."}),t.jsxs("div",{className:"app-acts",children:[t.jsx("button",{className:"btn sm",disabled:l.isPending,onClick:()=>j("restart",`Restarting ${e.name}`),children:"Restart"}),t.jsx("button",{className:"btn sm",disabled:l.isPending,onClick:()=>j("stop",`Stopped ${e.name}`),children:"Stop"})]}),t.jsx(X,{text:`squad app stop${g}`})]}),e.state==="failed"&&!L&&t.jsx("p",{className:"app-more why",children:e.error}),e.state!=="running"&&e.state!=="starting"&&T&&!L&&t.jsx(X,{text:`squad app start${g}${E}`}),e.state!=="running"&&e.state!=="starting"&&e.start&&e.up&&!L&&t.jsxs("p",{className:"app-more",children:["It looks like this app is already open on this computer."," ",t.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",children:"Open it"})]}),L&&t.jsxs("div",{className:"app-warn",children:[t.jsx("b",{children:e.error}),t.jsx("span",{children:L.ours?"squad-kit started it, so it can stop it for you.":"squad-kit leaves it alone. Close that program, then press Try again, or ask an engineer to look at what failed."}),L.ours&&t.jsx("div",{className:"app-acts",children:t.jsx("button",{className:"btn sm",disabled:l.isPending,onClick:()=>k({stopOther:!0}),children:"Stop it and start"})}),t.jsx(X,{text:L.ours?`squad app start${g} --stop-other`:`squad app start${g}`})]}),!e.start&&!b&&!h&&t.jsxs("div",{className:"app-warn",children:[t.jsx("b",{children:"Start command unknown"}),t.jsx("span",{children:"squad-kit could not tell how to start this app yet."}),a&&!i&&t.jsxs("span",{className:"bad",children:["The Architect could not read the project: ",a]}),t.jsxs("div",{className:"app-acts",children:[r&&t.jsx("button",{className:"btn sm",disabled:i||l.isPending,onClick:()=>l.mutate({path:"/api/v1/scan",done:"The Architect is reading the project to find how to start it"}),children:i?"The Architect is looking…":"Ask the Architect to find it"}),t.jsx("button",{className:"btn sm",onClick:()=>m(!0),children:"Type it"})]}),!r&&t.jsx("span",{children:"You can also set it in Settings, under How the squad checks and runs this project."}),t.jsx(X,{text:r?"squad app find":`squad app set${g} --start "npm run dev"`})]}),h&&t.jsx(jO,{a:e,cmdRef:g,onDone:()=>m(!1)}),e.start&&t.jsx("button",{className:"app-link",onClick:()=>x(!0),children:e.state==="failed"?"See what failed":"Show output"}),p&&t.jsx(kO,{a:e,cmdRef:g,onClose:()=>x(!1),onChange:()=>{x(!1),m(!0)}})]})}function yO({a:e}){const[n,s]=N.useState(!1);return t.jsxs("div",{className:"app-lead",children:[e.signIn&&t.jsxs("button",{className:`app-signin ${n?"all":""}`,onClick:()=>s(!n),"aria-expanded":n,title:n?void 0:e.signIn,children:[t.jsx("b",{children:"How to sign in"}),t.jsx(R,{className:"txt",text:e.signIn})]}),t.jsx(Ng,{className:"btn sm app-ask",label:"Ask about it",context:{from:"app",app:e.name,path:dT(e.address??e.url)}})]})}function jO({a:e,cmdRef:n,onDone:s}){const r=re(),[i,a]=N.useState(e.start??""),[l,c]=N.useState(e.url??""),u=()=>r.mutate({path:`/api/v1/apps/${encodeURIComponent(e.name)}/commands`,method:"PUT",body:{start:i,url:l},done:`Saved how ${e.name} starts`},{onSuccess:s});return t.jsxs("form",{className:"app-type",onSubmit:h=>{h.preventDefault(),u()},children:[t.jsxs("label",{children:["Start command",t.jsx("input",{className:"input",value:i,onChange:h=>a(h.target.value),placeholder:"npm run dev",autoFocus:!0,spellCheck:!1})]}),t.jsxs("label",{children:["Address",t.jsx("input",{className:"input",value:l,onChange:h=>c(h.target.value),placeholder:"http://localhost:3000",spellCheck:!1})]}),t.jsxs("div",{className:"app-acts",children:[t.jsx("button",{className:"btn sm pri",type:"submit",disabled:!i.trim()||r.isPending,children:"Save"}),t.jsx("button",{className:"btn sm",type:"button",onClick:s,children:"Cancel"})]}),t.jsx(X,{text:`squad app set${n} --start ${Me(i.trim()||"npm run dev")}${l.trim()?` --url ${Ci(l.trim())}`:""}`})]})}function kO({a:e,cmdRef:n,onClose:s,onChange:r}){const a=(ve({queryKey:["apps",e.name,"output"],queryFn:()=>ye(`/api/v1/apps/${encodeURIComponent(e.name)}/output`),refetchInterval:2e3}).data?.lines??[]).join(`
714
+ `).trim();return t.jsxs(Ye,{title:e.state==="failed"?`${e.name}: what failed`:`${e.name}: how it starts`,wide:!0,onClose:s,footer:t.jsxs(t.Fragment,{children:[t.jsx(X,{text:`squad app start${n}`}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn sm",onClick:r,children:"Change"}),t.jsx("button",{className:"btn sm pri",onClick:s,children:"Done"})]}),children:[e.state==="failed"&&e.detail&&t.jsx("pre",{className:"app-out",style:{marginBottom:12},children:e.detail}),t.jsxs("div",{className:"app-how",children:[t.jsxs("div",{children:[t.jsx("span",{children:"Start command"}),t.jsx("code",{children:e.start})]}),t.jsxs("div",{children:[t.jsx("span",{children:"Address"}),t.jsx("code",{children:e.address??e.url??"The one it prints when it starts"})]}),e.setup&&t.jsxs("div",{children:[t.jsx("span",{children:"Setup, in a new copy and when its packages change"}),t.jsx("code",{children:e.setup})]}),t.jsxs("div",{children:[t.jsxs("span",{children:["squad-kit's copy of ",e.base]}),t.jsxs("code",{children:[e.dir,e.commit?` at ${e.commit.slice(0,8)}`:""]})]})]}),t.jsx("pre",{className:"app-out",children:a||"Nothing yet. Press Start, and what the app prints shows here."})]})}function vO({children:e}){const n=zr({select:m=>m.location.pathname}),s=zr({select:m=>m.location.search.ticket}),r=Ia(wu),i=wO(),a=bO(n),l=n.startsWith("/board")&&!!s,[c,u]=N.useState(!1);N.useEffect(()=>u(!1),[s]);const h=l&&(r||i.is)&&a.length>0;return t.jsxs("div",{ref:i.ref,className:`banners ${h&&c?"unfolded":""}`,children:[h&&c&&t.jsxs("button",{className:"bless",onClick:()=>u(!1),"aria-expanded":!0,children:[t.jsx(Vv,{size:14,"aria-hidden":!0})," Show less"]}),h&&!c&&t.jsxs("button",{className:"bslim",onClick:()=>u(!0),"aria-expanded":!1,"aria-label":`${a.map(m=>m.text).join(", ")}. Show the messages`,children:[t.jsx("span",{className:"bchips",children:a.map(m=>t.jsx("span",{className:`bchip ${m.tone}`,children:m.text},m.key))}),t.jsx(Aa,{size:16,"aria-hidden":!0})]}),t.jsx("div",{className:"banners-all",hidden:h&&!c,children:e})]})}function bO(e){const n=yu().data,s=W4().data,r=De().data,i=[],a=n?YS(n):null;a&&i.push({key:"update",text:a,tone:n?.progress.state==="failed"?"you":"acc"}),s?.pause&&s.text&&i.push({key:"limit",text:"Usage limit",tone:"you"}),r?.ready&&r.console?.outdated&&i.push({key:"restart",text:"Restart to update",tone:"you"});const l=Ou(),c=r?.ready&&!e.startsWith("/inbox")?l:0;return c&&i.push({key:"waiting",text:`${c} need${c===1?"s":""} you`,tone:"you"}),i}function wO(){const[e,n]=N.useState(!1),s=N.useRef(null),r=N.useCallback(i=>{s.current?.disconnect(),!(!i||typeof ResizeObserver>"u")&&(s.current=new ResizeObserver(([a])=>n((a?.contentRect.width??1/0)<820)),s.current.observe(i))},[]);return N.useEffect(()=>()=>s.current?.disconnect(),[]),{ref:r,is:e}}function Bu(){return ve({queryKey:["setup"],queryFn:()=>ye("/api/v1/setup"),refetchInterval:e=>e.state.data?.setup&&!e.state.data.setup.ready&&!e.state.data.setup.approved?1e3:5e3})}function Z4(e=1e3){const[n,s]=N.useState(Date.now);return N.useEffect(()=>{const r=setInterval(()=>s(Date.now()),e);return()=>clearInterval(r)},[e]),n}function NO({state:e}){return t.jsx("i",{className:`ob-mark ${e}`,"aria-hidden":!0,children:e==="done"?t.jsx(ce,{size:13,strokeWidth:3}):e==="failed"?"!":e==="skipped"?"–":e==="stopped"?t.jsx(Jn,{size:8,fill:"currentColor"}):e==="now"?t.jsx("span",{className:"live"}):null})}function SO({st:e,now:n}){const s=re(),[r,i]=N.useState(!1),a=tf(e,n);return t.jsxs("li",{className:`ob-step ${e.state}`,children:[t.jsx(NO,{state:e.state}),t.jsxs("span",{className:"ob-st-t",children:[t.jsx("b",{children:e.label}),e.note&&t.jsx("small",{title:e.note,children:e.note}),e.state==="now"&&t.jsx("span",{className:"setup-bar","aria-hidden":!0,children:t.jsx("i",{})}),e.error&&t.jsx("span",{className:"ob-err",children:e.error}),e.ways.length>0&&t.jsxs("span",{className:"ob-ways",children:[e.ways.map(l=>l.do==="again"?t.jsxs("span",{className:"ob-way",children:[t.jsx("button",{className:"btn sm",disabled:s.isPending,onClick:()=>s.mutate({path:"/api/v1/setup/again",body:{step:l.step},done:l.step==="read"?"The Architect reads the project again":"squad-kit tries it again"}),children:l.label}),t.jsx(X,{text:l.command})]},l.label):l.do==="output"?t.jsx("button",{className:"btn sm quiet",onClick:()=>i(!r),"aria-expanded":r,children:r?"Hide what failed":l.label},l.label):t.jsx(ge,{to:"/settings",className:"btn sm quiet",children:l.label},l.label)),e.state==="failed"&&(e.id==="read"||e.id==="tool")&&t.jsx(Lu,{small:!0})]}),r&&e.output&&t.jsx("pre",{className:"ob-out",children:e.output})]}),t.jsxs("time",{className:"ob-time",children:[a,(e.state==="now"||e.state==="todo")&&t.jsx("small",{children:e.usual})]})]})}const CO=[{id:"best",name:"Best",note:"The strongest model builds and reviews. Uses your plan's limits faster."},{id:"balanced",name:"Balanced",note:"The strongest model at medium effort."},{id:"thrifty",name:"Thrifty",note:"A lighter model builds. Cheapest."}];function $O({s:e}){const n=re(),[s,r]=N.useState(null);if(e.approved)return null;const i=s??e.quality;return t.jsxs("section",{className:"ob-quality","aria-label":"Quality",children:[t.jsxs("div",{className:"ob-q-h",children:[t.jsx("b",{children:"How strong should the squad be?"}),t.jsx("span",{className:"note",children:e.qualityAsked?"Saved. Change it any time in Settings.":"Asked once. You can change it any time in Settings."})]}),t.jsx("div",{className:"ob-q-opts",role:"radiogroup","aria-label":"Quality",children:CO.map(a=>t.jsxs("button",{role:"radio","aria-checked":a.id===i,className:`ob-q ${a.id===i?"on":""}`,onClick:()=>{r(a.id),n.mutate({path:"/api/v1/setup/quality",body:{quality:a.id},done:`Quality is ${a.name}. The squad uses it from its first step.`})},children:[t.jsxs("b",{children:[a.name,a.id==="best"&&t.jsx("small",{children:" · the default"})]}),t.jsx("span",{children:a.note})]},a.id))}),t.jsx(X,{text:`squad config set quality ${i}`})]})}function TO({s:e}){const n=kg(),s=(()=>{try{return window.localStorage}catch{return null}})(),[r,i]=N.useState(()=>gt?rl(s).includes(gt):!1);return e.ready||e.approved||!gt?null:r&&n.on?t.jsxs("span",{className:"pill ok",children:[t.jsx(Ym,{size:13})," We will tell you when it is ready"]}):t.jsxs("button",{className:"btn",onClick:async()=>{n.on||await n.turnOn(),TC(s,gt),i(!0)},children:[t.jsx(Ym,{size:15})," Notify me when it is ready"]})}function EO({s:e}){const n=Z4();return t.jsx("ol",{className:"ob-steps",children:e.steps.map(s=>t.jsx(SO,{st:s,now:n},s.id))})}function AO({s:e}){const[n,s]=N.useState(!1);return e.reads.length?t.jsxs("div",{className:"ob-reads",children:[t.jsxs("button",{className:"btn sm quiet",onClick:()=>s(!n),"aria-expanded":n,children:[n?t.jsx(Vv,{size:14}):t.jsx(Aa,{size:14})," ",n?"Hide what the Architect read":"See what the Architect is reading"]}),n&&t.jsx("ul",{children:e.reads.map((r,i)=>t.jsx("li",{className:"mono",children:r},`${i}-${r}`))})]}):null}function X4(){const n=Bu().data?.setup,s=Z4();if(!n||n.approved)return null;if(n.ready)return t.jsxs("div",{className:"ob-card ready",children:[t.jsx("span",{className:"ob-ring",children:t.jsx(ce,{size:16,strokeWidth:2.5})}),t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:n.empty?n.idea?"Your first stories are ready":"One question for you":"Your project overview is ready"}),t.jsx("span",{children:n.empty?n.idea?"What the Architect understood from what you said, for you to check.":"What do you want to build?":"squad-kit has read your project. Check what it understood, then start working."})]}),t.jsxs(ge,{to:"/overview",className:"btn you sm",children:["Check it ",t.jsx(xa,{size:14})]})]});const r=n.steps.find(a=>a.id===n.current),i=n.steps.findIndex(a=>a.id===n.current)+1;return t.jsxs("div",{className:`ob-card ${r?.state==="failed"||r?.state==="stopped"?"stop":""}`,children:[t.jsxs("div",{className:"grow",children:[t.jsx("b",{children:"Getting to know your project"}),t.jsxs("span",{children:["Step ",i," of ",n.total,": ",r?.label??"starting",r&&tf(r,s)?` · ${tf(r,s)}`:""]}),r?.note&&r.state!=="todo"&&t.jsx("small",{title:r.note,children:r.note}),t.jsx("span",{className:"ob-dots","aria-hidden":!0,children:n.steps.map(a=>t.jsx("i",{className:a.state},a.id))})]}),t.jsxs(ge,{to:"/setup",className:"btn sm",children:["Open the setup ",t.jsx(xa,{size:14})]})]})}function PO(){const e=Bu().data?.setup;return!!(e&&!e.approved)}function RO(){const e=Bu().data?.setup;return!!(e?.ready&&!e.approved)}const J4={nextdotjs:{hex:"000000",path:"M18.665 21.978C16.758 23.255 14.465 24 12 24 5.377 24 0 18.623 0 12S5.377 0 12 0s12 5.377 12 12c0 3.583-1.574 6.801-4.067 9.001L9.219 7.2H7.2v9.596h1.615V9.251l9.85 12.727Zm-3.332-8.533 1.6 2.061V7.2h-1.6v6.245Z"},react:{hex:"61DAFB",path:"M14.23 12.004a2.236 2.236 0 0 1-2.235 2.236 2.236 2.236 0 0 1-2.236-2.236 2.236 2.236 0 0 1 2.235-2.236 2.236 2.236 0 0 1 2.236 2.236zm2.648-10.69c-1.346 0-3.107.96-4.888 2.622-1.78-1.653-3.542-2.602-4.887-2.602-.41 0-.783.093-1.106.278-1.375.793-1.683 3.264-.973 6.365C1.98 8.917 0 10.42 0 12.004c0 1.59 1.99 3.097 5.043 4.03-.704 3.113-.39 5.588.988 6.38.32.187.69.275 1.102.275 1.345 0 3.107-.96 4.888-2.624 1.78 1.654 3.542 2.603 4.887 2.603.41 0 .783-.09 1.106-.275 1.374-.792 1.683-3.263.973-6.365C22.02 15.096 24 13.59 24 12.004c0-1.59-1.99-3.097-5.043-4.032.704-3.11.39-5.587-.988-6.38-.318-.184-.688-.277-1.092-.278zm-.005 1.09v.006c.225 0 .406.044.558.127.666.382.955 1.835.73 3.704-.054.46-.142.945-.25 1.44-.96-.236-2.006-.417-3.107-.534-.66-.905-1.345-1.727-2.035-2.447 1.592-1.48 3.087-2.292 4.105-2.295zm-9.77.02c1.012 0 2.514.808 4.11 2.28-.686.72-1.37 1.537-2.02 2.442-1.107.117-2.154.298-3.113.538-.112-.49-.195-.964-.254-1.42-.23-1.868.054-3.32.714-3.707.19-.09.4-.127.563-.132zm4.882 3.05c.455.468.91.992 1.36 1.564-.44-.02-.89-.034-1.345-.034-.46 0-.915.01-1.36.034.44-.572.895-1.096 1.345-1.565zM12 8.1c.74 0 1.477.034 2.202.093.406.582.802 1.203 1.183 1.86.372.64.71 1.29 1.018 1.946-.308.655-.646 1.31-1.013 1.95-.38.66-.773 1.288-1.18 1.87-.728.063-1.466.098-2.21.098-.74 0-1.477-.035-2.202-.093-.406-.582-.802-1.204-1.183-1.86-.372-.64-.71-1.29-1.018-1.946.303-.657.646-1.313 1.013-1.954.38-.66.773-1.286 1.18-1.868.728-.064 1.466-.098 2.21-.098zm-3.635.254c-.24.377-.48.763-.704 1.16-.225.39-.435.782-.635 1.174-.265-.656-.49-1.31-.676-1.947.64-.15 1.315-.283 2.015-.386zm7.26 0c.695.103 1.365.23 2.006.387-.18.632-.405 1.282-.66 1.933-.2-.39-.41-.783-.64-1.174-.225-.392-.465-.774-.705-1.146zm3.063.675c.484.15.944.317 1.375.498 1.732.74 2.852 1.708 2.852 2.476-.005.768-1.125 1.74-2.857 2.475-.42.18-.88.342-1.355.493-.28-.958-.646-1.956-1.1-2.98.45-1.017.81-2.01 1.085-2.964zm-13.395.004c.278.96.645 1.957 1.1 2.98-.45 1.017-.812 2.01-1.086 2.964-.484-.15-.944-.318-1.37-.5-1.732-.737-2.852-1.706-2.852-2.474 0-.768 1.12-1.742 2.852-2.476.42-.18.88-.342 1.356-.494zm11.678 4.28c.265.657.49 1.312.676 1.948-.64.157-1.316.29-2.016.39.24-.375.48-.762.705-1.158.225-.39.435-.788.636-1.18zm-9.945.02c.2.392.41.783.64 1.175.23.39.465.772.705 1.143-.695-.102-1.365-.23-2.006-.386.18-.63.406-1.282.66-1.933zM17.92 16.32c.112.493.2.968.254 1.423.23 1.868-.054 3.32-.714 3.708-.147.09-.338.128-.563.128-1.012 0-2.514-.807-4.11-2.28.686-.72 1.37-1.536 2.02-2.44 1.107-.118 2.154-.3 3.113-.54zm-11.83.01c.96.234 2.006.415 3.107.532.66.905 1.345 1.727 2.035 2.446-1.595 1.483-3.092 2.295-4.11 2.295-.22-.005-.406-.05-.553-.132-.666-.38-.955-1.834-.73-3.703.054-.46.142-.944.25-1.438zm4.56.64c.44.02.89.034 1.345.034.46 0 .915-.01 1.36-.034-.44.572-.895 1.095-1.345 1.565-.455-.47-.91-.993-1.36-1.565z"},typescript:{hex:"3178C6",path:"M1.125 0C.502 0 0 .502 0 1.125v21.75C0 23.498.502 24 1.125 24h21.75c.623 0 1.125-.502 1.125-1.125V1.125C24 .502 23.498 0 22.875 0zm17.363 9.75c.612 0 1.154.037 1.627.111a6.38 6.38 0 0 1 1.306.34v2.458a3.95 3.95 0 0 0-.643-.361 5.093 5.093 0 0 0-.717-.26 5.453 5.453 0 0 0-1.426-.2c-.3 0-.573.028-.819.086a2.1 2.1 0 0 0-.623.242c-.17.104-.3.229-.393.374a.888.888 0 0 0-.14.49c0 .196.053.373.156.529.104.156.252.304.443.444s.423.276.696.41c.273.135.582.274.926.416.47.197.892.407 1.266.628.374.222.695.473.963.753.268.279.472.598.614.957.142.359.214.776.214 1.253 0 .657-.125 1.21-.373 1.656a3.033 3.033 0 0 1-1.012 1.085 4.38 4.38 0 0 1-1.487.596c-.566.12-1.163.18-1.79.18a9.916 9.916 0 0 1-1.84-.164 5.544 5.544 0 0 1-1.512-.493v-2.63a5.033 5.033 0 0 0 3.237 1.2c.333 0 .624-.03.872-.09.249-.06.456-.144.623-.25.166-.108.29-.234.373-.38a1.023 1.023 0 0 0-.074-1.089 2.12 2.12 0 0 0-.537-.5 5.597 5.597 0 0 0-.807-.444 27.72 27.72 0 0 0-1.007-.436c-.918-.383-1.602-.852-2.053-1.405-.45-.553-.676-1.222-.676-2.005 0-.614.123-1.141.369-1.582.246-.441.58-.804 1.004-1.089a4.494 4.494 0 0 1 1.47-.629 7.536 7.536 0 0 1 1.77-.201zm-15.113.188h9.563v2.166H9.506v9.646H6.789v-9.646H3.375z"},javascript:{hex:"F7DF1E",path:"M0 0h24v24H0V0zm22.034 18.276c-.175-1.095-.888-2.015-3.003-2.873-.736-.345-1.554-.585-1.797-1.14-.091-.33-.105-.51-.046-.705.15-.646.915-.84 1.515-.66.39.12.75.42.976.9 1.034-.676 1.034-.676 1.755-1.125-.27-.42-.404-.601-.586-.78-.63-.705-1.469-1.065-2.834-1.034l-.705.089c-.676.165-1.32.525-1.71 1.005-1.14 1.291-.811 3.541.569 4.471 1.365 1.02 3.361 1.244 3.616 2.205.24 1.17-.87 1.545-1.966 1.41-.811-.18-1.26-.586-1.755-1.336l-1.83 1.051c.21.48.45.689.81 1.109 1.74 1.756 6.09 1.666 6.871-1.004.029-.09.24-.705.074-1.65l.046.067zm-8.983-7.245h-2.248c0 1.938-.009 3.864-.009 5.805 0 1.232.063 2.363-.138 2.711-.33.689-1.18.601-1.566.48-.396-.196-.597-.466-.83-.855-.063-.105-.11-.196-.127-.196l-1.825 1.125c.305.63.75 1.172 1.324 1.517.855.51 2.004.675 3.207.405.783-.226 1.458-.691 1.811-1.411.51-.93.402-2.07.397-3.346.012-2.054 0-4.109 0-6.179l.004-.056z"},prisma:{hex:"2D3748",path:"M21.8068 18.2848L13.5528.7565c-.207-.4382-.639-.7273-1.1286-.7541-.5023-.0293-.9523.213-1.2062.6253L2.266 15.1271c-.2773.4518-.2718 1.0091.0158 1.4555l4.3759 6.7786c.2608.4046.7127.6388 1.1823.6388.1332 0 .267-.0188.3987-.0577l12.7019-3.7568c.3891-.1151.7072-.3904.8737-.7553s.1633-.7828-.0075-1.1454zm-1.8481.7519L9.1814 22.2242c-.3292.0975-.6448-.1873-.5756-.5194l3.8501-18.4386c.072-.3448.5486-.3996.699-.0803l7.1288 15.138c.1344.2856-.019.6224-.325.7128z"},sqlite:{hex:"003B57",path:"M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71 8.71 0 0 0-.547.535c-2.109 2.237-4.066 6.38-4.674 9.544.237.48.422 1.093.544 1.561a13.044 13.044 0 0 1 .164.703s-.019-.071-.096-.296l-.05-.146a1.689 1.689 0 0 0-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376 1.176.484.884.778 2.4.778 2.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304 1.346-.226 1.478.152.256.296.698.422 1.186.286 1.1.485 2.44.485 2.44l.017.224a22.41 22.41 0 0 0 .056 2.748c.095 1.146.273 2.13.5 2.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29 1.661-8.304 1.723-4.55 4.113-8.201 6.3-9.945-1.993 1.8-4.692 7.63-5.5 9.788-.904 2.416-1.545 4.684-1.931 6.857.666-2.037 2.821-2.912 2.821-2.912s1.057-1.304 2.292-3.166c-.74.169-1.955.458-2.362.629-.6.251-.762.337-.762.337s1.945-1.184 3.613-1.72C21.695 7.9 24.195 2.767 21.678.521m-18.573.543A1.842 1.842 0 0 0 1.27 2.9v16.608a1.84 1.84 0 0 0 1.835 1.834h9.418a22.953 22.953 0 0 1-.052-2.707c-.006-.062-.011-.141-.016-.2a27.01 27.01 0 0 0-.473-2.378c-.121-.47-.275-.898-.369-1.057-.116-.197-.098-.31-.097-.432 0-.12.015-.245.037-.386a9.98 9.98 0 0 1 .234-1.045l.217-.028c-.017-.035-.014-.065-.031-.097l-.041-.381a32.8 32.8 0 0 1 .382-1.194l.2-.019c-.008-.016-.01-.038-.018-.053l-.043-.316c.63-3.28 2.587-7.443 4.8-9.791.066-.069.133-.128.198-.194Z"},vitest:{hex:"6E9F18",path:"M13.74024 1.05293a.49504.49504 0 0 0-.1569.02512.49338.49338 0 0 0-.25056.1876L7.59513 9.56159a.4895.4895 0 0 0-.08373.22327.48846.48846 0 0 0 .03163.23629.4893.4893 0 0 0 .13985.19319.4927.4927 0 0 0 .2149.10481l3.70685.78609-.22947 4.58007a.48834.48834 0 0 0 .08466.30017.49205.49205 0 0 0 .24931.18854c.10157.03398.21174.03444.3135.00064a.49387.49387 0 0 0 .25056-.18761l5.73735-8.29594a.4884.4884 0 0 0 .08404-.22327c.009-.08015-.0016-.16137-.03163-.23629a.48835.48835 0 0 0-.13985-.19319.49318.49318 0 0 0-.2149-.1048l-3.70686-.7861.22947-4.58008a.48802.48802 0 0 0-.08466-.30017.4913.4913 0 0 0-.24931-.18853.49439.49439 0 0 0-.1566-.02574zM1.15697 9.78795c-.30647.0012-.60009.12378-.81679.34048a1.16107 1.16107 0 0 0-.34017.81648 1.162 1.162 0 0 0 .33366.81957l10.84241 10.8421a1.15762 1.15762 0 0 0 .37677.25211 1.1583 1.1583 0 0 0 .44467.08838c.00084 0 .0016-.00031.0025-.00031.00073 0 .0014.00031.0022.00031a1.15827 1.15827 0 0 0 .44467-.08838 1.15731 1.15731 0 0 0 .37677-.2521l10.84236-10.8421a1.16272 1.16272 0 0 0 .33397-.81958c-.0013-.30647-.12376-.59976-.34048-.81648a1.1616 1.1616 0 0 0-.81679-.34048 1.16114 1.16114 0 0 0-.81926.33366l-5.4012 5.4009c-.0078.0074-.01718.01255-.02482.02015L12 20.14011l-4.59776-4.59745c-.0074-.0074-.01659-.01238-.02419-.01954l-5.4015-5.40151a1.162 1.162 0 0 0-.81958-.33366Z"},eslint:{hex:"4B32C3",path:"M7.257 9.132L11.816 6.5a.369.369 0 0 1 .368 0l4.559 2.632a.369.369 0 0 1 .184.32v5.263a.37.37 0 0 1-.184.319l-4.559 2.632a.369.369 0 0 1-.368 0l-4.559-2.632a.369.369 0 0 1-.184-.32V9.452a.37.37 0 0 1 .184-.32M23.852 11.53l-5.446-9.475c-.198-.343-.564-.596-.96-.596H6.555c-.396 0-.762.253-.96.596L.149 11.509a1.127 1.127 0 0 0 0 1.117l5.447 9.398c.197.342.563.517.959.517h10.893c.395 0 .76-.17.959-.512l5.446-9.413a1.069 1.069 0 0 0 0-1.086m-4.51 4.556a.4.4 0 0 1-.204.338L12.2 20.426a.395.395 0 0 1-.392 0l-6.943-4.002a.4.4 0 0 1-.205-.338V8.08c0-.14.083-.269.204-.338L11.8 3.74c.12-.07.272-.07.392 0l6.943 4.003a.4.4 0 0 1 .206.338z"},primereact:{hex:"03C4E8",path:"M12.01 0c-1.212 0-2.297.62-2.903 1.66l-1.52 2.608H4.303A3.287 3.287 0 0 0 1.43 5.911a3.226 3.226 0 0 0 0 3.285l1.642 2.819-1.646 2.825a3.202 3.202 0 0 0 0 3.261 3.265 3.265 0 0 0 2.851 1.631h2.925l.865.856L9.09 22.34A3.322 3.322 0 0 0 11.991 24c1.211 0 2.296-.62 2.902-1.66l.816-1.4 1.22-1.208h2.77a3.287 3.287 0 0 0 2.87-1.643c.6-1.028.6-2.256 0-3.285l-1.642-2.82 1.646-2.824a3.202 3.202 0 0 0 0-3.261 3.265 3.265 0 0 0-2.851-1.631H16.43L14.91 1.66A3.322 3.322 0 0 0 12.01 0Zm0 .719c.948 0 1.798.486 2.273 1.3l1.31 2.249H8.425l1.31-2.248A2.603 2.603 0 0 1 12.01.719Zm.33 4.265v7.74h.962l5.904-2.174.014-.057.87 1.492-1.33 2.282.171-3.173-1.51.543-1.51 1.494-1.237-.27.962 1.357v4.212l1.452-1.296-.708 1.216v.001l-.744.622v.654l-.412.708V14.49l-1.098-1.63-.687.407h-2.746l-.687-.407-1.098 1.63v6.101l-.412-.706v-.912l-1.036-.867-.729-1.25 1.765 1.574v-4.212l.961-1.358-1.236.271-1.51-1.494-1.511-.543.188 3.455-1.477-2.534.942-1.617.122-.208.088.36 5.904 2.174h.824V4.985Zm1.512 0h.412l.96 2.17 1.935-.2.237.406-2.452.192zm-3.985.001h.412L9.187 7.552l-2.556-.205.072-.124.001.001.163-.28 2.04.21Zm-5.565.001h2.867L5.831 7.282l-1.592-.127.49 2.018-1.237 2.124-1.433-2.46a2.52 2.52 0 0 1 0-2.567 2.568 2.568 0 0 1 2.243-1.284Zm12.547 0h2.873c.928 0 1.759.476 2.223 1.272a2.497 2.497 0 0 1 0 2.543l-1.437 2.466-1.042-1.789.563-2.323-1.833.143Zm3.659 7.718 1.433 2.46a2.52 2.52 0 0 1 0 2.566 2.567 2.567 0 0 1-2.243 1.283h-2.277V18zm-17.016.03 3.22 5.525v.754H4.277a2.545 2.545 0 0 1-2.223-1.27 2.497 2.497 0 0 1 0-2.544z"},tailwindcss:{hex:"06B6D4",path:"M12.001,4.8c-3.2,0-5.2,1.6-6,4.8c1.2-1.6,2.6-2.2,4.2-1.8c0.913,0.228,1.565,0.89,2.288,1.624 C13.666,10.618,15.027,12,18.001,12c3.2,0,5.2-1.6,6-4.8c-1.2,1.6-2.6,2.2-4.2,1.8c-0.913-0.228-1.565-0.89-2.288-1.624 C16.337,6.182,14.976,4.8,12.001,4.8z M6.001,12c-3.2,0-5.2,1.6-6,4.8c1.2-1.6,2.6-2.2,4.2-1.8c0.913,0.228,1.565,0.89,2.288,1.624 c1.177,1.194,2.538,2.576,5.512,2.576c3.2,0,5.2-1.6,6-4.8c-1.2,1.6-2.6,2.2-4.2,1.8c-0.913-0.228-1.565-0.89-2.288-1.624 C10.337,13.382,8.976,12,6.001,12z"},nodedotjs:{hex:"5FA04E",path:"M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383 c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076 c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0 L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392 c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021 c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921 c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603 v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z M19.099,13.993 c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233 c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081 c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833 c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402 c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253 c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z"},postgresql:{hex:"4169E1",path:"M23.5594 14.7228a.5269.5269 0 0 0-.0563-.1191c-.139-.2632-.4768-.3418-1.0074-.2321-1.6533.3411-2.2935.1312-2.5256-.0191 1.342-2.0482 2.445-4.522 3.0411-6.8297.2714-1.0507.7982-3.5237.1222-4.7316a1.5641 1.5641 0 0 0-.1509-.235C21.6931.9086 19.8007.0248 17.5099.0005c-1.4947-.0158-2.7705.3461-3.1161.4794a9.449 9.449 0 0 0-.5159-.0816 8.044 8.044 0 0 0-1.3114-.1278c-1.1822-.0184-2.2038.2642-3.0498.8406-.8573-.3211-4.7888-1.645-7.2219.0788C.9359 2.1526.3086 3.8733.4302 6.3043c.0409.818.5069 3.334 1.2423 5.7436.4598 1.5065.9387 2.7019 1.4334 3.582.553.9942 1.1259 1.5933 1.7143 1.7895.4474.1491 1.1327.1441 1.8581-.7279.8012-.9635 1.5903-1.8258 1.9446-2.2069.4351.2355.9064.3625 1.39.3772a.0569.0569 0 0 0 .0004.0041 11.0312 11.0312 0 0 0-.2472.3054c-.3389.4302-.4094.5197-1.5002.7443-.3102.064-1.1344.2339-1.1464.8115-.0025.1224.0329.2309.0919.3268.2269.4231.9216.6097 1.015.6331 1.3345.3335 2.5044.092 3.3714-.6787-.017 2.231.0775 4.4174.3454 5.0874.2212.5529.7618 1.9045 2.4692 1.9043.2505 0 .5263-.0291.8296-.0941 1.7819-.3821 2.5557-1.1696 2.855-2.9059.1503-.8707.4016-2.8753.5388-4.1012.0169-.0703.0357-.1207.057-.1362.0007-.0005.0697-.0471.4272.0307a.3673.3673 0 0 0 .0443.0068l.2539.0223.0149.001c.8468.0384 1.9114-.1426 2.5312-.4308.6438-.2988 1.8057-1.0323 1.5951-1.6698zM2.371 11.8765c-.7435-2.4358-1.1779-4.8851-1.2123-5.5719-.1086-2.1714.4171-3.6829 1.5623-4.4927 1.8367-1.2986 4.8398-.5408 6.108-.13-.0032.0032-.0066.0061-.0098.0094-2.0238 2.044-1.9758 5.536-1.9708 5.7495-.0002.0823.0066.1989.0162.3593.0348.5873.0996 1.6804-.0735 2.9184-.1609 1.1504.1937 2.2764.9728 3.0892.0806.0841.1648.1631.2518.2374-.3468.3714-1.1004 1.1926-1.9025 2.1576-.5677.6825-.9597.5517-1.0886.5087-.3919-.1307-.813-.5871-1.2381-1.3223-.4796-.839-.9635-2.0317-1.4155-3.5126zm6.0072 5.0871c-.1711-.0428-.3271-.1132-.4322-.1772.0889-.0394.2374-.0902.4833-.1409 1.2833-.2641 1.4815-.4506 1.9143-1.0002.0992-.126.2116-.2687.3673-.4426a.3549.3549 0 0 0 .0737-.1298c.1708-.1513.2724-.1099.4369-.0417.156.0646.3078.26.3695.4752.0291.1016.0619.2945-.0452.4444-.9043 1.2658-2.2216 1.2494-3.1676 1.0128zm2.094-3.988-.0525.141c-.133.3566-.2567.6881-.3334 1.003-.6674-.0021-1.3168-.2872-1.8105-.8024-.6279-.6551-.9131-1.5664-.7825-2.5004.1828-1.3079.1153-2.4468.079-3.0586-.005-.0857-.0095-.1607-.0122-.2199.2957-.2621 1.6659-.9962 2.6429-.7724.4459.1022.7176.4057.8305.928.5846 2.7038.0774 3.8307-.3302 4.7363-.084.1866-.1633.3629-.2311.5454zm7.3637 4.5725c-.0169.1768-.0358.376-.0618.5959l-.146.4383a.3547.3547 0 0 0-.0182.1077c-.0059.4747-.054.6489-.115.8693-.0634.2292-.1353.4891-.1794 1.0575-.11 1.4143-.8782 2.2267-2.4172 2.5565-1.5155.3251-1.7843-.4968-2.0212-1.2217a6.5824 6.5824 0 0 0-.0769-.2266c-.2154-.5858-.1911-1.4119-.1574-2.5551.0165-.5612-.0249-1.9013-.3302-2.6462.0044-.2932.0106-.5909.019-.8918a.3529.3529 0 0 0-.0153-.1126 1.4927 1.4927 0 0 0-.0439-.208c-.1226-.4283-.4213-.7866-.7797-.9351-.1424-.059-.4038-.1672-.7178-.0869.067-.276.1831-.5875.309-.9249l.0529-.142c.0595-.16.134-.3257.213-.5012.4265-.9476 1.0106-2.2453.3766-5.1772-.2374-1.0981-1.0304-1.6343-2.2324-1.5098-.7207.0746-1.3799.3654-1.7088.5321a5.6716 5.6716 0 0 0-.1958.1041c.0918-1.1064.4386-3.1741 1.7357-4.4823a4.0306 4.0306 0 0 1 .3033-.276.3532.3532 0 0 0 .1447-.0644c.7524-.5706 1.6945-.8506 2.802-.8325.4091.0067.8017.0339 1.1742.081 1.939.3544 3.2439 1.4468 4.0359 2.3827.8143.9623 1.2552 1.9315 1.4312 2.4543-1.3232-.1346-2.2234.1268-2.6797.779-.9926 1.4189.543 4.1729 1.2811 5.4964.1353.2426.2522.4522.2889.5413.2403.5825.5515.9713.7787 1.2552.0696.087.1372.1714.1885.245-.4008.1155-1.1208.3825-1.0552 1.717-.0123.1563-.0423.4469-.0834.8148-.0461.2077-.0702.4603-.0994.7662zm.8905-1.6211c-.0405-.8316.2691-.9185.5967-1.0105a2.8566 2.8566 0 0 0 .135-.0406 1.202 1.202 0 0 0 .1342.103c.5703.3765 1.5823.4213 3.0068.1344-.2016.1769-.5189.3994-.9533.6011-.4098.1903-1.0957.333-1.7473.3636-.7197.0336-1.0859-.0807-1.1721-.151zm.5695-9.2712c-.0059.3508-.0542.6692-.1054 1.0017-.055.3576-.112.7274-.1264 1.1762-.0142.4368.0404.8909.0932 1.3301.1066.887.216 1.8003-.2075 2.7014a3.5272 3.5272 0 0 1-.1876-.3856c-.0527-.1276-.1669-.3326-.3251-.6162-.6156-1.1041-2.0574-3.6896-1.3193-4.7446.3795-.5427 1.3408-.5661 2.1781-.463zm.2284 7.0137a12.3762 12.3762 0 0 0-.0853-.1074l-.0355-.0444c.7262-1.1995.5842-2.3862.4578-3.4385-.0519-.4318-.1009-.8396-.0885-1.2226.0129-.4061.0666-.7543.1185-1.0911.0639-.415.1288-.8443.1109-1.3505.0134-.0531.0188-.1158.0118-.1902-.0457-.4855-.5999-1.938-1.7294-3.253-.6076-.7073-1.4896-1.4972-2.6889-2.0395.5251-.1066 1.2328-.2035 2.0244-.1859 2.0515.0456 3.6746.8135 4.8242 2.2824a.908.908 0 0 1 .0667.1002c.7231 1.3556-.2762 6.2751-2.9867 10.5405zm-8.8166-6.1162c-.025.1794-.3089.4225-.6211.4225a.5821.5821 0 0 1-.0809-.0056c-.1873-.026-.3765-.144-.5059-.3156-.0458-.0605-.1203-.178-.1055-.2844.0055-.0401.0261-.0985.0925-.1488.1182-.0894.3518-.1226.6096-.0867.3163.0441.6426.1938.6113.4186zm7.9305-.4114c.0111.0792-.049.201-.1531.3102-.0683.0717-.212.1961-.4079.2232a.5456.5456 0 0 1-.075.0052c-.2935 0-.5414-.2344-.5607-.3717-.024-.1765.2641-.3106.5611-.352.297-.0414.6111.0088.6356.1851z"},vite:{hex:"646CFF",path:"m8.286 10.578.512-8.657a.306.306 0 0 1 .247-.282L17.377.006a.306.306 0 0 1 .353.385l-1.558 5.403a.306.306 0 0 0 .352.385l2.388-.46a.306.306 0 0 1 .332.438l-6.79 13.55-.123.19a.294.294 0 0 1-.252.14c-.177 0-.35-.152-.305-.369l1.095-5.301a.306.306 0 0 0-.388-.355l-1.433.435a.306.306 0 0 1-.389-.354l.69-3.375a.306.306 0 0 0-.37-.36l-2.32.536a.306.306 0 0 1-.374-.316zm14.976-7.926L17.284 3.74l-.544 1.887 2.077-.4a.8.8 0 0 1 .84.369.8.8 0 0 1 .034.783L12.9 19.93l-.013.025-.015.023-.122.19a.801.801 0 0 1-.672.37.826.826 0 0 1-.634-.302.8.8 0 0 1-.16-.67l1.029-4.981-1.12.34a.81.81 0 0 1-.86-.262.802.802 0 0 1-.165-.67l.63-3.08-2.027.468a.808.808 0 0 1-.768-.233.81.81 0 0 1-.217-.6l.389-6.57-7.44-1.33a.612.612 0 0 0-.64.906L11.58 23.691a.612.612 0 0 0 1.066-.004l11.26-20.135a.612.612 0 0 0-.644-.9z"},angular:{hex:"0F0F11",path:"M16.712 17.711H7.288l-1.204 2.916L12 24l5.916-3.373-1.204-2.916ZM14.692 0l7.832 16.855.814-12.856L14.692 0ZM9.308 0 .662 3.999l.814 12.856L9.308 0Zm-.405 13.93h6.198L12 6.396 8.903 13.93Z"},vuedotjs:{hex:"4FC08D",path:"M24,1.61H14.06L12,5.16,9.94,1.61H0L12,22.39ZM12,14.08,5.16,2.23H9.59L12,6.41l2.41-4.18h4.43Z"},dotnet:{hex:"512BD4",path:"M24 8.77h-2.468v7.565h-1.425V8.77h-2.462V7.53H24zm-6.852 7.565h-4.821V7.53h4.63v1.24h-3.205v2.494h2.953v1.234h-2.953v2.604h3.396zm-6.708 0H8.882L4.78 9.863a2.896 2.896 0 0 1-.258-.51h-.036c.032.189.048.592.048 1.21v5.772H3.157V7.53h1.659l3.965 6.32c.167.261.275.442.323.54h.024c-.04-.233-.06-.629-.06-1.185V7.529h1.372zm-8.703-.693a.868.829 0 0 1-.869.829.868.829 0 0 1-.868-.83.868.829 0 0 1 .868-.828.868.829 0 0 1 .869.829Z"},python:{hex:"3776AB",path:"M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z"},jest:{hex:"C21325",path:"M22.251 11.82a3.117 3.117 0 0 0-2.328-3.01L22.911 0H8.104L11.1 8.838a3.116 3.116 0 0 0-2.244 2.988c0 1.043.52 1.967 1.313 2.536a8.279 8.279 0 0 1-1.084 1.244 8.14 8.14 0 0 1-2.55 1.647c-.834-.563-1.195-1.556-.869-2.446a3.11 3.11 0 0 0-.91-6.08 3.117 3.117 0 0 0-3.113 3.113c0 .848.347 1.626.903 2.182-.048.097-.097.195-.146.299-.465.959-.993 2.043-1.195 3.259-.403 2.432.257 4.384 1.849 5.489A5.093 5.093 0 0 0 5.999 24c1.827 0 3.682-.917 5.475-1.807 1.279-.632 2.599-1.292 3.898-1.612.48-.118.98-.187 1.508-.264 1.07-.153 2.175-.312 3.168-.89a4.482 4.482 0 0 0 2.182-3.091c.174-.994 0-1.994-.444-2.87.298-.48.465-1.042.465-1.647zm-1.355 0c0 .965-.785 1.75-1.75 1.75a1.753 1.753 0 0 1-1.085-3.126l.007-.007c.056-.042.118-.084.18-.125 0 0 .008 0 .008-.007.028-.014.055-.035.083-.05.007 0 .014-.006.021-.006.028-.014.063-.028.097-.042.035-.014.07-.027.098-.041.007 0 .013-.007.02-.007.028-.007.056-.021.084-.028.007 0 .02-.007.028-.007.034-.007.062-.014.097-.02h.007l.104-.022c.007 0 .02 0 .028-.007.028 0 .055-.007.083-.007h.035c.035 0 .07-.007.111-.007h.09c.028 0 .05 0 .077.007h.014c.055.007.111.014.167.028a1.766 1.766 0 0 1 1.396 1.723zM10.043 1.39h10.93l-2.509 7.4c-.104.02-.208.055-.312.09l-2.64-5.385-2.648 5.35c-.104-.034-.216-.055-.327-.076l-2.494-7.38zm4.968 9.825a3.083 3.083 0 0 0-.938-1.668l1.438-2.904 1.452 2.967c-.43.43-.743.98-.868 1.605H15.01zm-3.481-1.098c.034-.007.062-.014.097-.02h.02c.029-.008.056-.008.084-.015h.028c.028 0 .049-.007.076-.007h.271c.028 0 .049.007.07.007.014 0 .02 0 .035.007.027.007.048.007.076.014.007 0 .014 0 .028.007l.097.02h.007c.028.008.056.015.083.029.007 0 .014.007.028.007.021.007.049.014.07.027.007 0 .014.007.02.007.028.014.056.021.084.035h.007a.374.374 0 0 1 .09.049h.007c.028.014.056.034.084.048.007 0 .007.007.013.007.028.014.05.035.077.049l.007.007c.083.062.16.132.236.201l.007.007a1.747 1.747 0 0 1 .48 1.209 1.752 1.752 0 0 1-3.502 0 1.742 1.742 0 0 1 1.32-1.695zm-6.838-.049c.966 0 1.751.786 1.751 1.751s-.785 1.751-1.75 1.751-1.752-.785-1.752-1.75.786-1.752 1.751-1.752zm16.163 6.025a3.07 3.07 0 0 1-1.508 2.133c-.758.438-1.689.577-2.669.716a17.29 17.29 0 0 0-1.64.291c-1.445.355-2.834 1.05-4.182 1.717-1.724.854-3.35 1.66-4.857 1.66a3.645 3.645 0 0 1-2.154-.688c-1.529-1.056-1.453-3.036-1.272-4.12.167-1.015.632-1.966 1.077-2.877.028-.055.049-.104.077-.16.152.056.312.098.479.126-.264 1.473.486 2.994 1.946 3.745l.264.139.284-.104c1.216-.431 2.342-1.133 3.336-2.071a9.334 9.334 0 0 0 1.445-1.716c.16.027.32.034.48.034a3.117 3.117 0 0 0 3.008-2.327h1.167a3.109 3.109 0 0 0 3.01 2.327c.576 0 1.11-.16 1.57-.43.18.52.236 1.063.139 1.605z"},prettier:{hex:"F7B93E",path:"M8.571 23.429A.571.571 0 0 1 8 24H2.286a.571.571 0 0 1 0-1.143H8c.316 0 .571.256.571.572zM8 20.57H6.857a.571.571 0 0 0 0 1.143H8a.571.571 0 0 0 0-1.143zm-5.714 1.143H4.57a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zM8 18.286H2.286a.571.571 0 0 0 0 1.143H8a.571.571 0 0 0 0-1.143zM16 16H5.714a.571.571 0 0 0 0 1.143H16A.571.571 0 0 0 16 16zM2.286 17.143h1.143a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zm17.143-3.429H16a.571.571 0 0 0 0 1.143h3.429a.571.571 0 0 0 0-1.143zM9.143 14.857h4.571a.571.571 0 0 0 0-1.143H9.143a.571.571 0 0 0 0 1.143zm-6.857 0h4.571a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zM20.57 11.43H11.43a.571.571 0 0 0 0 1.142h9.142a.571.571 0 0 0 0-1.142zM9.714 12a.571.571 0 0 0-.571-.571H5.714a.571.571 0 0 0 0 1.142h3.429A.571.571 0 0 0 9.714 12zm-7.428.571h1.143a.571.571 0 0 0 0-1.142H2.286a.571.571 0 0 0 0 1.142zm19.428-3.428H16a.571.571 0 0 0 0 1.143h5.714a.571.571 0 0 0 0-1.143zM2.286 10.286H8a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zm13.143-2.857c0 .315.255.571.571.571h5.714a.571.571 0 0 0 0-1.143H16a.571.571 0 0 0-.571.572zm-8.572-.572a.571.571 0 0 0 0 1.143H8a.571.571 0 0 0 0-1.143H6.857zM2.286 8H4.57a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zm16.571-2.857c0 .315.256.571.572.571h1.142a.571.571 0 0 0 0-1.143H19.43a.571.571 0 0 0-.572.572zm-1.143 0a.571.571 0 0 0-.571-.572H12.57a.571.571 0 0 0 0 1.143h4.572a.571.571 0 0 0 .571-.571zm-15.428.571h8a.571.571 0 0 0 0-1.143h-8a.571.571 0 0 0 0 1.143zm5.143-2.857c0 .316.255.572.571.572h11.429a.571.571 0 0 0 0-1.143H8a.571.571 0 0 0-.571.571zm-5.143.572h3.428a.571.571 0 0 0 0-1.143H2.286a.571.571 0 0 0 0 1.143zm0-2.286H16A.571.571 0 0 0 16 0H2.286a.571.571 0 0 0 0 1.143z"},express:{hex:"000000",path:"M24 18.588a1.529 1.529 0 01-1.895-.72l-3.45-4.771-.5-.667-4.003 5.444a1.466 1.466 0 01-1.802.708l5.158-6.92-4.798-6.251a1.595 1.595 0 011.9.666l3.576 4.83 3.596-4.81a1.435 1.435 0 011.788-.668L21.708 7.9l-2.522 3.283a.666.666 0 000 .994l4.804 6.412zM.002 11.576l.42-2.075c1.154-4.103 5.858-5.81 9.094-3.27 1.895 1.489 2.368 3.597 2.275 5.973H1.116C.943 16.447 4.005 19.009 7.92 17.7a4.078 4.078 0 002.582-2.876c.207-.666.548-.78 1.174-.588a5.417 5.417 0 01-2.589 3.957 6.272 6.272 0 01-7.306-.933 6.575 6.575 0 01-1.64-3.858c0-.235-.08-.455-.134-.666A88.33 88.33 0 010 11.577zm1.127-.286h9.654c-.06-3.076-2.001-5.258-4.59-5.278-2.882-.04-4.944 2.094-5.071 5.264z"},mongodb:{hex:"47A248",path:"M17.193 9.555c-1.264-5.58-4.252-7.414-4.573-8.115-.28-.394-.53-.954-.735-1.44-.036.495-.055.685-.523 1.184-.723.566-4.438 3.682-4.74 10.02-.282 5.912 4.27 9.435 4.888 9.884l.07.05A73.49 73.49 0 0111.91 24h.481c.114-1.032.284-2.056.51-3.07.417-.296.604-.463.85-.693a11.342 11.342 0 003.639-8.464c.01-.814-.103-1.662-.197-2.218zm-5.336 8.195s0-8.291.275-8.29c.213 0 .49 10.695.49 10.695-.381-.045-.765-1.76-.765-2.405z"},mysql:{hex:"4479A1",path:"M16.405 5.501c-.115 0-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77 18.695h-.927a50.854 50.854 0 00-.27-4.41h-.008l-1.41 4.41H2.45l-1.4-4.41h-.01a72.892 72.892 0 00-.195 4.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335 4.064h.008l1.347-4.064h1.095c.242 2.015.384 3.86.428 5.53zm4.017-4.08c-.378 2.045-.876 3.533-1.492 4.46-.482.716-1.01 1.073-1.583 1.073-.153 0-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268 0 .483-.075.647-.222.197-.18.295-.382.295-.605 0-.155-.077-.47-.23-.944L6.23 14.615h.91l.727 2.36c.164.536.233.91.205 1.123.4-1.064.678-2.227.835-3.483zm12.325 4.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253 0-1.83-.718-2.746-2.155-2.746-.704 0-1.254.232-1.65.697-.43.508-.646 1.256-.646 2.245 0 .972.19 1.686.574 2.14.35.41.877.615 1.583.615.264 0 .506-.033.725-.098l1.325.772.36-.622zM15.5 17.588c-.225-.36-.337-.94-.337-1.736 0-1.393.424-2.09 1.27-2.09.443 0 .77.167.977.5.224.362.336.936.336 1.723 0 1.404-.424 2.108-1.27 2.108-.445 0-.77-.167-.978-.5zm-1.658-.425c0 .47-.172.856-.516 1.156-.344.3-.803.45-1.384.45-.543 0-1.064-.172-1.573-.515l.237-.476c.438.22.833.328 1.19.328.332 0 .593-.073.783-.22a.754.754 0 00.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177 0-.45.157-.81.47-1.085.315-.278.72-.415 1.22-.415.512 0 .98.136 1.4.41l-.213.476a2.726 2.726 0 00-1.064-.23c-.283 0-.502.068-.654.206a.685.685 0 00-.248.524c0 .328.234.61.666.85.393.215 1.187.67 1.187.67.433.305.648.63.648 1.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223 3.223 0 00-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867 8.867 0 00-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69 17.69 0 01-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422 1.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146 1.693.194 2.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445 3.445 0 01-.35-.4 8.76 8.76 0 01-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188 1.01-.027.007-.014 0-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478 2.478 0 01-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953 5.953 0 012.085 2.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z"},redis:{hex:"FF4438",path:"M22.71 13.145c-1.66 2.092-3.452 4.483-7.038 4.483-3.203 0-4.397-2.825-4.48-5.12.701 1.484 2.073 2.685 4.214 2.63 4.117-.133 6.94-3.852 6.94-7.239 0-4.05-3.022-6.972-8.268-6.972-3.752 0-8.4 1.428-11.455 3.685C2.59 6.937 3.885 9.958 4.35 9.626c2.648-1.904 4.748-3.13 6.784-3.744C8.12 9.244.886 17.05 0 18.425c.1 1.261 1.66 4.648 2.424 4.648.232 0 .431-.133.664-.365a100.49 100.49 0 0 0 5.54-6.765c.222 3.104 1.748 6.898 6.014 6.898 3.819 0 7.604-2.756 9.33-8.965.2-.764-.73-1.361-1.261-.73zm-4.349-5.013c0 1.959-1.926 2.922-3.685 2.922-.941 0-1.664-.247-2.235-.568 1.051-1.592 2.092-3.225 3.21-4.973 1.972.334 2.71 1.43 2.71 2.619z"},docker:{hex:"2496ED",path:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z"},zod:{hex:"408AFF",path:"M2.584 3.582a2.247 2.247 0 0 1 2.112-1.479h14.617c.948 0 1.794.595 2.115 1.487l2.44 6.777a2.248 2.248 0 0 1-.624 2.443l-9.61 8.52a2.247 2.247 0 0 1-2.963.018L.776 12.773a2.248 2.248 0 0 1-.64-2.467Zm12.038 4.887-9.11 5.537 5.74 5.007c.456.399 1.139.396 1.593-.006l5.643-5.001H14.4l6.239-3.957c.488-.328.69-.947.491-1.5l-1.24-3.446a1.535 1.535 0 0 0-1.456-1.015H5.545a1.535 1.535 0 0 0-1.431 1.01l-1.228 3.37z"},hono:{hex:"E36002",path:"M12.445.002a45.529 45.529 0 0 0-5.252 8.146 8.595 8.595 0 0 1-.555-.53 27.796 27.796 0 0 0-1.205-1.542 8.762 8.762 0 0 0-1.251 2.12 20.743 20.743 0 0 0-1.448 5.88 8.867 8.867 0 0 0 .338 3.468c1.312 3.48 3.794 5.593 7.445 6.337 3.055.438 5.755-.333 8.097-2.312 2.677-2.59 3.359-5.634 2.047-9.132a33.287 33.287 0 0 0-2.988-5.59A91.34 91.34 0 0 0 12.615.053a.216.216 0 0 0-.17-.051Zm-.336 3.906a50.93 50.93 0 0 1 4.794 6.552c.448.767.817 1.57 1.108 2.41.606 2.386-.044 4.354-1.951 5.904-1.845 1.298-3.87 1.683-6.072 1.156-2.376-.737-3.75-2.335-4.121-4.794a5.107 5.107 0 0 1 .242-2.266c.358-.908.79-1.774 1.3-2.601l1.446-2.121a397.33 397.33 0 0 0 3.254-4.24Z"},svelte:{hex:"FF3E00",path:"M10.354 21.125a4.44 4.44 0 0 1-4.765-1.767 4.109 4.109 0 0 1-.703-3.107 3.898 3.898 0 0 1 .134-.522l.105-.321.287.21a7.21 7.21 0 0 0 2.186 1.092l.208.063-.02.208a1.253 1.253 0 0 0 .226.83 1.337 1.337 0 0 0 1.435.533 1.231 1.231 0 0 0 .343-.15l5.59-3.562a1.164 1.164 0 0 0 .524-.778 1.242 1.242 0 0 0-.211-.937 1.338 1.338 0 0 0-1.435-.533 1.23 1.23 0 0 0-.343.15l-2.133 1.36a4.078 4.078 0 0 1-1.135.499 4.44 4.44 0 0 1-4.765-1.766 4.108 4.108 0 0 1-.702-3.108 3.855 3.855 0 0 1 1.742-2.582l5.589-3.563a4.072 4.072 0 0 1 1.135-.499 4.44 4.44 0 0 1 4.765 1.767 4.109 4.109 0 0 1 .703 3.107 3.943 3.943 0 0 1-.134.522l-.105.321-.286-.21a7.204 7.204 0 0 0-2.187-1.093l-.208-.063.02-.207a1.255 1.255 0 0 0-.226-.831 1.337 1.337 0 0 0-1.435-.532 1.231 1.231 0 0 0-.343.15L8.62 9.368a1.162 1.162 0 0 0-.524.778 1.24 1.24 0 0 0 .211.937 1.338 1.338 0 0 0 1.435.533 1.235 1.235 0 0 0 .344-.151l2.132-1.36a4.067 4.067 0 0 1 1.135-.498 4.44 4.44 0 0 1 4.765 1.766 4.108 4.108 0 0 1 .702 3.108 3.857 3.857 0 0 1-1.742 2.583l-5.589 3.562a4.072 4.072 0 0 1-1.135.499m10.358-17.95C18.484-.015 14.082-.96 10.9 1.068L5.31 4.63a6.412 6.412 0 0 0-2.896 4.295 6.753 6.753 0 0 0 .666 4.336 6.43 6.43 0 0 0-.96 2.396 6.833 6.833 0 0 0 1.168 5.167c2.229 3.19 6.63 4.135 9.812 2.108l5.59-3.562a6.41 6.41 0 0 0 2.896-4.295 6.756 6.756 0 0 0-.665-4.336 6.429 6.429 0 0 0 .958-2.396 6.831 6.831 0 0 0-1.167-5.168Z"},nestjs:{hex:"E0234E",path:"M14.131.047c-.173 0-.334.037-.483.087.316.21.49.49.576.806.007.043.019.074.025.117a.681.681 0 0 1 .013.112c.024.545-.143.614-.26.936-.18.415-.13.861.086 1.22a.74.74 0 0 0 .074.137c-.235-1.568 1.073-1.803 1.314-2.293.019-.428-.334-.713-.613-.911a1.37 1.37 0 0 0-.732-.21zM16.102.4c-.024.143-.006.106-.012.18-.006.05-.006.112-.012.161-.013.05-.025.1-.044.149-.012.05-.03.1-.05.149l-.067.142c-.02.025-.031.05-.05.075l-.037.055a2.152 2.152 0 0 1-.093.124c-.037.038-.068.081-.112.112v.006c-.037.031-.074.068-.118.1-.13.099-.278.173-.415.266-.043.03-.087.056-.124.093a.906.906 0 0 0-.118.099c-.043.037-.074.074-.111.118-.031.037-.068.08-.093.124a1.582 1.582 0 0 0-.087.13c-.025.05-.043.093-.068.142-.019.05-.037.093-.05.143a2.007 2.007 0 0 0-.043.155c-.006.025-.006.056-.012.08-.007.025-.007.05-.013.075 0 .05-.006.105-.006.155 0 .037 0 .074.006.111 0 .05.006.1.019.155.006.05.018.1.03.15.02.049.032.098.05.148.013.03.031.062.044.087l-1.426-.552c-.241-.068-.477-.13-.719-.186l-.39-.093c-.372-.074-.75-.13-1.128-.167-.013 0-.019-.006-.031-.006A11.082 11.082 0 0 0 8.9 2.855c-.378.025-.756.074-1.134.136a12.45 12.45 0 0 0-.837.174l-.279.074c-.092.037-.18.08-.266.118l-.205.093c-.012.006-.024.006-.03.012-.063.031-.118.056-.174.087a2.738 2.738 0 0 0-.236.118c-.043.018-.086.043-.124.062a.559.559 0 0 1-.055.03c-.056.032-.112.063-.162.094a1.56 1.56 0 0 0-.148.093c-.044.03-.087.055-.124.086-.006.007-.013.007-.019.013-.037.025-.08.056-.118.087l-.012.012-.093.074c-.012.007-.025.019-.037.025-.031.025-.062.056-.093.08-.006.013-.019.02-.025.025-.037.038-.074.069-.111.106-.007 0-.007.006-.013.012a1.742 1.742 0 0 0-.111.106c-.007.006-.007.012-.013.012a1.454 1.454 0 0 0-.093.1c-.012.012-.03.024-.043.036a1.374 1.374 0 0 1-.106.112c-.006.012-.018.019-.024.03-.05.05-.093.1-.143.15l-.018.018c-.1.106-.205.211-.317.304-.111.1-.229.192-.347.273a3.777 3.777 0 0 1-.762.421c-.13.056-.267.106-.403.149-.26.056-.527.161-.756.18-.05 0-.105.012-.155.018l-.155.037-.149.056c-.05.019-.099.044-.148.068-.044.031-.093.056-.137.087a1.011 1.011 0 0 0-.124.106c-.043.03-.087.074-.124.111-.037.043-.074.08-.105.124-.031.05-.068.093-.093.143a1.092 1.092 0 0 0-.087.142c-.025.056-.05.106-.068.161-.019.05-.037.106-.056.161-.012.05-.025.1-.03.15 0 .005-.007.012-.007.018-.012.056-.012.13-.019.167C.006 7.95 0 7.986 0 8.03a.657.657 0 0 0 .074.31v.006c.019.037.044.075.069.112.024.037.05.074.08.111.031.031.068.069.106.1a.906.906 0 0 0 .117.099c.149.13.186.173.378.272.031.019.062.031.1.05.006 0 .012.006.018.006 0 .013 0 .019.006.031a1.272 1.272 0 0 0 .08.298c.02.037.032.074.05.111.007.013.013.025.02.031.024.05.049.093.073.137l.093.13c.031.037.069.08.106.118.037.037.074.068.118.105 0 0 .006.006.012.006.037.031.074.062.112.087a.986.986 0 0 0 .136.08c.043.025.093.05.142.069a.73.73 0 0 0 .124.043c.007.006.013.006.025.012.025.007.056.013.08.019-.018.335-.024.65.026.762.055.124.328-.254.6-.688-.036.428-.061.93 0 1.079.069.155.44-.329.763-.862 4.395-1.016 8.405 2.02 8.826 6.31-.08-.67-.905-1.041-1.283-.948-.186.458-.502 1.047-1.01 1.413.043-.41.025-.83-.062-1.24a4.009 4.009 0 0 1-.769 1.562c-.588.043-1.177-.242-1.487-.67-.025-.018-.031-.055-.05-.08-.018-.043-.037-.087-.05-.13a.515.515 0 0 1-.037-.13c-.006-.044-.006-.087-.006-.137v-.093a.992.992 0 0 1 .031-.13c.013-.043.025-.086.044-.13.024-.043.043-.087.074-.13.105-.298.105-.54-.087-.682a.706.706 0 0 0-.118-.062c-.024-.006-.055-.018-.08-.025l-.05-.018a.847.847 0 0 0-.13-.031.472.472 0 0 0-.13-.019 1.01 1.01 0 0 0-.136-.012c-.031 0-.062.006-.093.006a.484.484 0 0 0-.137.019c-.043.006-.086.012-.13.024a1.068 1.068 0 0 0-.13.044c-.043.018-.08.037-.124.056-.037.018-.074.043-.118.062-1.444.942-.582 3.148.403 3.787-.372.068-.75.148-.855.229l-.013.012c.267.161.546.298.837.416.397.13.818.247 1.004.297v.006a5.996 5.996 0 0 0 1.562.112c2.746-.192 4.996-2.281 5.405-5.033l.037.161c.019.112.043.23.056.347v.006c.012.056.018.112.025.162v.024c.006.056.012.112.012.162.006.068.012.136.012.204v.1c0 .03.007.067.007.098 0 .038-.007.075-.007.112v.087c0 .043-.006.08-.006.124 0 .025 0 .05-.006.08 0 .044-.006.087-.006.137-.006.018-.006.037-.006.055l-.02.143c0 .019 0 .037-.005.056-.007.062-.019.118-.025.18v.012l-.037.174v.018l-.037.167c0 .007-.007.02-.007.025a1.663 1.663 0 0 1-.043.168v.018c-.019.062-.037.118-.05.174-.006.006-.006.012-.006.012l-.056.186c-.024.062-.043.118-.068.18-.025.062-.043.124-.068.18-.025.062-.05.117-.074.18h-.007c-.024.055-.05.117-.08.173a.302.302 0 0 1-.019.043c-.006.006-.006.013-.012.019a5.867 5.867 0 0 1-1.742 2.082c-.05.031-.099.069-.149.106-.012.012-.03.018-.043.03a2.603 2.603 0 0 1-.136.094l.018.037h.007l.26-.037h.006c.161-.025.322-.056.483-.087.044-.006.093-.019.137-.031l.087-.019c.043-.006.086-.018.13-.024.037-.013.074-.02.111-.031.62-.15 1.221-.354 1.798-.595a9.926 9.926 0 0 1-3.85 3.142c.714-.05 1.426-.167 2.114-.366a9.903 9.903 0 0 0 5.857-4.68 9.893 9.893 0 0 1-1.667 3.986 9.758 9.758 0 0 0 1.655-1.376 9.824 9.824 0 0 0 2.61-5.268c.21.98.272 1.99.18 2.987 4.474-6.241.371-12.712-1.346-14.416-.006-.013-.012-.019-.012-.031-.006.006-.006.006-.006.012 0-.006 0-.006-.007-.012 0 .074-.006.148-.012.223a8.34 8.34 0 0 1-.062.415c-.03.136-.068.273-.105.41-.044.13-.093.266-.15.396a5.322 5.322 0 0 1-.185.378 4.735 4.735 0 0 1-.477.688c-.093.111-.192.21-.292.31a3.994 3.994 0 0 1-.18.155l-.142.124a3.459 3.459 0 0 1-.347.241 4.295 4.295 0 0 1-.366.211c-.13.062-.26.118-.39.174a4.364 4.364 0 0 1-.818.223c-.143.025-.285.037-.422.05a4.914 4.914 0 0 1-.297.012 4.66 4.66 0 0 1-.422-.025 3.137 3.137 0 0 1-.421-.062 3.136 3.136 0 0 1-.415-.105h-.007c.137-.013.273-.025.41-.05a4.493 4.493 0 0 0 .818-.223c.136-.05.266-.112.39-.174.13-.062.248-.13.372-.204.118-.08.235-.161.347-.248.112-.087.217-.18.316-.279.105-.093.198-.198.291-.304.093-.111.18-.223.26-.334.013-.019.026-.044.038-.062.062-.1.124-.199.18-.298a4.272 4.272 0 0 0 .334-.775c.044-.13.075-.266.106-.403.025-.142.05-.278.062-.415.012-.142.025-.285.025-.421 0-.1-.007-.199-.013-.298a6.726 6.726 0 0 0-.05-.415 4.493 4.493 0 0 0-.092-.415c-.044-.13-.087-.267-.137-.397-.05-.13-.111-.26-.173-.384-.069-.124-.137-.248-.211-.366a6.843 6.843 0 0 0-.248-.34c-.093-.106-.186-.212-.285-.317a3.878 3.878 0 0 0-.161-.155c-.28-.217-.57-.421-.862-.607a1.154 1.154 0 0 0-.124-.062 2.415 2.415 0 0 0-.589-.26Z"},cypress:{hex:"69D3A7",path:"M11.998.0195c-.8642 0-1.6816.1101-2.1445.1934v.002C4.1731 1.2283 0 6.1368 0 12.0018c0 1.1265.1573 2.2328.4648 3.3028.0387.1453.0915.2993.1368.4473 1.607 4.865 6.2245 8.226 11.3925 8.2285.0651 0 .2518-.0003.502-.0118.8564-.0353 1.6228-.5734 1.9512-1.369l.4736-1.1544L20.4258 8.043H18.621l-2.3164 5.871-2.334-5.871h-1.9082l3.2734 8.0117c-.8115 1.9702-1.6252 3.9395-2.4355 5.9101-.0808.1945-.2655.3284-.4727.336-.144.005-.285.0098-.4316.0098-4.5848 0-8.6672-3.0695-9.9277-7.4649a10.3058 10.3058 0 0 1-.3985-2.8437c0-5.0887 3.6521-9.3404 8.6035-10.164.2214-.037.8885-.1446 1.7246-.1446 4.4166 0 8.269 2.732 9.7305 6.8476.0558.144.0977.293.1465.4395.299.9746.4531 1.9887.4531 3.0215 0 4.5696-2.9413 8.5326-7.3164 9.8613l.4863 1.5996c5.085-1.546 8.4995-6.1518 8.502-11.459 0-1.5491-.2983-2.8706-.6504-3.8926-.0432-.1212-.0873-.2422-.1309-.3633h-.002C21.4577 3.0954 17.0444.0195 11.998.0195ZM8.4336 7.8906c-1.1999 0-2.1747.3852-2.9805 1.1758-.8007.7856-1.205 1.7736-1.205 2.9356 0 1.1544.4068 2.1368 1.205 2.9199.8058.7906 1.7806 1.1738 2.9805 1.1738 1.705 0 3.1556-.955 3.7871-2.4883l.0332-.082-1.6289-.5547c-.168.4563-.7552 1.4883-2.1914 1.4883-.6745 0-1.2437-.2344-1.6934-.6992-.4572-.4699-.6875-1.0632-.6875-1.7578 0-.6998.2253-1.2809.6875-1.7735.4522-.4648 1.019-.7012 1.6934-.7012 1.438 0 2.0238 1.0815 2.1934 1.4883l1.627-.5527-.0333-.084c-.629-1.5358-2.082-2.4883-3.7871-2.4883Z"},storybook:{hex:"FF4785",path:"M16.71.243l-.12 2.71a.18.18 0 00.29.15l1.06-.8.9.7a.18.18 0 00.28-.14l-.1-2.76 1.33-.1a1.2 1.2 0 011.279 1.2v21.596a1.2 1.2 0 01-1.26 1.2l-16.096-.72a1.2 1.2 0 01-1.15-1.16l-.75-19.797a1.2 1.2 0 011.13-1.27L16.7.222zM13.64 9.3c0 .47 3.16.24 3.59-.08 0-3.2-1.72-4.89-4.859-4.89-3.15 0-4.899 1.72-4.899 4.29 0 4.45 5.999 4.53 5.999 6.959 0 .7-.32 1.1-1.05 1.1-.96 0-1.35-.49-1.3-2.16 0-.36-3.649-.48-3.769 0-.27 4.03 2.23 5.2 5.099 5.2 2.79 0 4.969-1.49 4.969-4.18 0-4.77-6.099-4.64-6.099-6.999 0-.97.72-1.1 1.13-1.1.45 0 1.25.07 1.19 1.87z"},graphql:{hex:"E10098",path:"M12.002 0a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm8.54 4.931a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm0 9.862a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm-8.54 4.931a2.138 2.138 0 1 0 0 4.276 2.138 2.138 0 1 0 0-4.276zm-8.542-4.93a2.138 2.138 0 1 0 0 4.276 2.138 2.138 0 1 0 0-4.277zm0-9.863a2.138 2.138 0 1 0 0 4.277 2.138 2.138 0 1 0 0-4.277zm8.542-3.378L2.953 6.777v10.448l9.049 5.224 9.047-5.224V6.777zm0 1.601 7.66 13.27H4.34zm-1.387.371L3.97 15.037V7.363zm2.774 0 6.646 3.838v7.674zM5.355 17.44h13.293l-6.646 3.836z"},trpc:{hex:"2596BE",path:"M24 12c0 6.62-5.38 12-12 12S0 18.62 0 12 5.38 0 12 0s12 5.38 12 12ZM1.21 12A10.78 10.78 0 0 0 12 22.79 10.78 10.78 0 0 0 22.79 12 10.78 10.78 0 0 0 12 1.21 10.78 10.78 0 0 0 1.21 12Zm10.915-6.086 2.162 1.248a.25.25 0 0 1 .125.217v1.103l2.473 1.428a.25.25 0 0 1 .125.217v2.355l.955.551a.25.25 0 0 1 .125.217v2.496a.25.25 0 0 1-.125.217l-2.162 1.248a.25.25 0 0 1-.25 0l-.956-.552-2.472 1.427a.25.25 0 0 1-.25 0l-2.472-1.427-.956.552a.25.25 0 0 1-.25 0l-2.162-1.248a.25.25 0 0 1-.125-.217V13.25a.25.25 0 0 1 .125-.217l.955-.551v-2.355a.25.25 0 0 1 .125-.217l2.473-1.428V7.38a.25.25 0 0 1 .125-.217l2.162-1.248a.25.25 0 0 1 .25 0Zm1.268 10.049a.25.25 0 0 1-.125-.217V13.25a.25.25 0 0 1 .125-.217l2.16-1.248a.25.25 0 0 1 .25 0l.707.408v-1.922l-2.098-1.21v.814a.25.25 0 0 1-.125.217l-2.162 1.248a.25.25 0 0 1-.25 0l-2.162-1.248a.25.25 0 0 1-.125-.217V9.06L7.49 10.271v1.922l.707-.408a.25.25 0 0 1 .25 0l2.16 1.248a.25.25 0 0 1 .125.217v2.496a.25.25 0 0 1-.125.217l-.705.408L12 17.582l2.098-1.211ZM10.088 9.73l1.662.96V8.766l-1.662-.955Zm3.824 0V7.811l-1.662.955v1.924ZM12 6.418l-1.66.96 1.66.954 1.66-.954Zm-5.59 9.184 1.66.958v-1.921l-1.66-.956Zm3.822 0v-1.92l-1.662.957v1.923Zm-1.91-3.311-1.662.96 1.661.955 1.66-.956Zm5.446 3.31 1.66.96v-1.922l-1.66-.956Zm3.822 0v-1.918l-1.662.956v1.922Zm-1.912-3.31-1.66.96 1.66.955 1.66-.956Z"},redux:{hex:"764ABC",path:"M16.634 16.504c.87-.075 1.543-.84 1.5-1.754-.047-.914-.796-1.648-1.709-1.648h-.061a1.71 1.71 0 00-1.648 1.769c.03.479.226.869.494 1.153-1.048 2.038-2.621 3.536-5.005 4.795-1.603.838-3.296 1.154-4.944.93-1.378-.195-2.456-.81-3.116-1.799-.988-1.499-1.078-3.116-.255-4.734.6-1.17 1.499-2.023 2.099-2.443a9.96 9.96 0 01-.42-1.543C-.868 14.408-.416 18.752.932 20.805c1.004 1.498 3.057 2.456 5.304 2.456.6 0 1.23-.044 1.843-.194 3.897-.749 6.848-3.086 8.541-6.532zm5.348-3.746c-2.32-2.728-5.738-4.226-9.634-4.226h-.51c-.253-.554-.837-.899-1.498-.899h-.045c-.943 0-1.678.81-1.647 1.753.03.898.794 1.648 1.708 1.648h.074a1.69 1.69 0 001.499-1.049h.555c2.309 0 4.495.674 6.488 1.992 1.527 1.005 2.622 2.323 3.237 3.897.538 1.288.509 2.547-.045 3.597-.855 1.647-2.294 2.517-4.196 2.517-1.199 0-2.367-.375-2.967-.644-.36.298-.96.793-1.394 1.093 1.318.598 2.652.943 3.94.943 2.922 0 5.094-1.647 5.919-3.236.898-1.798.824-4.824-1.47-7.416zM6.49 17.042c.03.899.793 1.648 1.708 1.648h.06a1.688 1.688 0 001.648-1.768c0-.9-.779-1.647-1.693-1.647h-.06c-.06 0-.15 0-.226.029-1.243-2.098-1.768-4.347-1.572-6.772.12-1.828.72-3.417 1.797-4.735.9-1.124 2.593-1.68 3.747-1.708 3.236-.061 4.585 3.971 4.689 5.574l1.498.45C17.741 3.197 14.686.62 11.764.62 9.02.62 6.49 2.613 5.47 5.535 4.077 9.43 4.991 13.177 6.7 16.174c-.15.195-.24.539-.21.868z"},i18next:{hex:"26A69A",path:"M14.93646 2.48699v4.51684l5.0758 13.03647s1.5495 3.1839-2.8824 3.9597H7.01922s-4.13084-.4311-3.14053-3.7019L9.21276 7.00401V2.48699h5.7237Zm2.0894 13.10781c-4.4301-1.3742-8.15457-.6365-9.97498-.0788l-1.83572 4.4186c-.78296 2.499 2.27302 2.9417 2.59687 2.9813l.02755.0032h8.44448c3.5407-.5982 2.511-2.972 2.4147-3.1773l-.0068-.0142-1.6661-4.1328Zm-7.81345.7772c.78905.0004 1.42905.3862 1.42905.8646 0 .4764-.6404.864-1.42905.864-.7887 0-1.42711-.3878-1.42711-.864 0-.4784.6384-.8646 1.4271-.8646Zm5.08375 0c.7871.0004 1.4271.3862 1.4271.8646 0 .4764-.6403.864-1.4271.864-.791 0-1.429-.3878-1.429-.864 0-.4784.638-.8646 1.429-.8646Zm-4.5001-5.2131c-.55227 0-.99993.5395-.99993 1.2051 0 .6656.44766 1.2051.99993 1.2051.5522 0 .9998-.5395.9998-1.2051 0-.6656-.4476-1.2051-.9998-1.2051Zm3.6413-1.29686c-.6549 0-1.1862.63806-1.1862 1.42906 0 .7871.5313 1.4271 1.1862 1.4271.653 0 1.1862-.64 1.1862-1.4271 0-.7907-.5328-1.42906-1.1862-1.42906Zm6.0363-2.73783s-2.1219 1.54591-4.0858-.41975V4.55615s2.7243-.60065 4.0858 2.56806Zm-14.84367 0C5.9908 3.9555 8.71543 4.55615 8.71543 4.55615v2.14831c-1.96566 1.96566-4.08544.41975-4.08544.41975ZM15.04366 0c.4954 0 .8958.4387.8958.98109 0 .54203-.4006.98074-.8958.98074H8.95478c-.49315 0-.89428-.43871-.89428-.98074C8.0605.43871 8.46146 0 8.95478 0h6.08888Z"},mui:{hex:"007FFF",path:"M20.229 15.793a.666.666 0 0 0 .244-.243.666.666 0 0 0 .09-.333l.012-3.858a.666.666 0 0 1 .09-.333.666.666 0 0 1 .245-.243L23 9.58a.667.667 0 0 1 .333-.088.667.667 0 0 1 .333.09.667.667 0 0 1 .244.243.666.666 0 0 1 .089.333v7.014a.667.667 0 0 1-.335.578l-7.893 4.534a.666.666 0 0 1-.662 0l-6.194-3.542a.667.667 0 0 1-.246-.244.667.667 0 0 1-.09-.335v-3.537c0-.004.004-.006.008-.004s.008 0 .008-.005v-.004c0-.003.002-.005.004-.007l5.102-2.93c.004-.003.002-.01-.003-.01a.005.005 0 0 1-.004-.002.005.005 0 0 1-.001-.004l.01-3.467a.667.667 0 0 0-.333-.58.667.667 0 0 0-.667 0L8.912 9.799a.667.667 0 0 1-.665 0l-3.804-2.19a.667.667 0 0 0-.999.577v6.267a.667.667 0 0 1-.332.577.666.666 0 0 1-.332.09.667.667 0 0 1-.333-.088L.336 13.825a.667.667 0 0 1-.246-.244.667.667 0 0 1-.09-.336L.019 2.292a.667.667 0 0 1 .998-.577l7.23 4.153a.667.667 0 0 0 .665 0l7.228-4.153a.666.666 0 0 1 .333-.088.666.666 0 0 1 .333.09.667.667 0 0 1 .244.244.667.667 0 0 1 .088.333V13.25c0 .117-.03.232-.089.334a.667.667 0 0 1-.245.244l-3.785 2.18a.667.667 0 0 0-.245.245.666.666 0 0 0-.089.334.667.667 0 0 0 .09.334.666.666 0 0 0 .247.244l2.088 1.189a.67.67 0 0 0 .33.087.667.667 0 0 0 .332-.089l4.457-2.56Zm.438-9.828a.666.666 0 0 0 .09.335.666.666 0 0 0 .248.244.667.667 0 0 0 .67-.008l2.001-1.2a.666.666 0 0 0 .237-.243.667.667 0 0 0 .087-.329V2.32a.667.667 0 0 0-.091-.335.667.667 0 0 0-.584-.33.667.667 0 0 0-.334.094l-2 1.2a.666.666 0 0 0-.238.243.668.668 0 0 0-.086.329v2.445Z"},bootstrap:{hex:"7952B3",path:"M11.77 11.24H9.956V8.202h2.152c1.17 0 1.834.522 1.834 1.466 0 1.008-.773 1.572-2.174 1.572zm.324 1.206H9.957v3.348h2.231c1.459 0 2.232-.585 2.232-1.685s-.795-1.663-2.326-1.663zM24 11.39v1.218c-1.128.108-1.817.944-2.226 2.268-.407 1.319-.463 2.937-.42 4.186.045 1.3-.968 2.5-2.337 2.5H4.985c-1.37 0-2.383-1.2-2.337-2.5.043-1.249-.013-2.867-.42-4.186-.41-1.324-1.1-2.16-2.228-2.268V11.39c1.128-.108 1.819-.944 2.227-2.268.408-1.319.464-2.937.42-4.186-.045-1.3.968-2.5 2.338-2.5h14.032c1.37 0 2.382 1.2 2.337 2.5-.043 1.249.013 2.867.42 4.186.409 1.324 1.098 2.16 2.226 2.268zm-7.927 2.817c0-1.354-.953-2.333-2.368-2.488v-.057c1.04-.169 1.856-1.135 1.856-2.213 0-1.537-1.213-2.538-3.062-2.538h-4.16v10.172h4.181c2.218 0 3.553-1.086 3.553-2.876z"},sass:{hex:"CC6699",path:"M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zM9.615 15.998c.175.645.156 1.248-.024 1.792l-.065.18c-.024.061-.052.12-.078.176-.14.29-.326.56-.555.81-.698.759-1.672 1.047-2.09.805-.45-.262-.226-1.335.584-2.19.871-.918 2.12-1.509 2.12-1.509v-.003l.108-.061zm9.911-10.861c-.542-2.133-4.077-2.834-7.422-1.645-1.989.707-4.144 1.818-5.693 3.267C4.568 8.48 4.275 9.98 4.396 10.607c.427 2.211 3.457 3.657 4.703 4.73v.006c-.367.18-3.056 1.529-3.686 2.925-.675 1.47.105 2.521.615 2.655 1.575.436 3.195-.36 4.065-1.649.84-1.261.766-2.881.404-3.676.496-.135 1.08-.195 1.83-.104 2.101.24 2.521 1.56 2.43 2.1-.09.539-.523.854-.674.944-.15.091-.195.12-.181.181.015.09.091.09.21.075.165-.03 1.096-.45 1.141-1.471.045-1.29-1.186-2.729-3.375-2.7-.9.016-1.471.091-1.875.256-.03-.045-.061-.075-.105-.105-1.35-1.455-3.855-2.475-3.75-4.41.03-.705.285-2.564 4.8-4.814 3.705-1.846 6.661-1.335 7.171-.21.733 1.604-1.576 4.59-5.431 5.024-1.47.165-2.235-.404-2.431-.615-.209-.225-.239-.24-.314-.194-.12.06-.045.255 0 .375.12.3.585.825 1.396 1.095.704.225 2.43.359 4.5-.45 2.324-.899 4.139-3.405 3.614-5.505l.073.067z"},drizzle:{hex:"C5F74F",path:"M5.353 11.823a1.036 1.036 0 0 0-.395-1.422 1.063 1.063 0 0 0-1.437.399L.138 16.702a1.035 1.035 0 0 0 .395 1.422 1.063 1.063 0 0 0 1.437-.398l3.383-5.903Zm11.216 0a1.036 1.036 0 0 0-.394-1.422 1.064 1.064 0 0 0-1.438.399l-3.382 5.902a1.036 1.036 0 0 0 .394 1.422c.506.283 1.15.104 1.438-.398l3.382-5.903Zm7.293-4.525a1.036 1.036 0 0 0-.395-1.422 1.062 1.062 0 0 0-1.437.399l-3.383 5.902a1.036 1.036 0 0 0 .395 1.422 1.063 1.063 0 0 0 1.437-.399l3.383-5.902Zm-11.219 0a1.035 1.035 0 0 0-.394-1.422 1.064 1.064 0 0 0-1.438.398l-3.382 5.903a1.036 1.036 0 0 0 .394 1.422c.506.282 1.15.104 1.438-.399l3.382-5.902Z"},supabase:{hex:"3FCF8E",path:"M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z"},firebase:{hex:"DD2C00",path:"M19.455 8.369c-.538-.748-1.778-2.285-3.681-4.569-.826-.991-1.535-1.832-1.884-2.245a146 146 0 0 0-.488-.576l-.207-.245-.113-.133-.022-.032-.01-.005L12.57 0l-.609.488c-1.555 1.246-2.828 2.851-3.681 4.64-.523 1.064-.864 2.105-1.043 3.176-.047.241-.088.489-.121.738-.209-.017-.421-.028-.632-.033-.018-.001-.035-.002-.059-.003a7.46 7.46 0 0 0-2.28.274l-.317.089-.163.286c-.765 1.342-1.198 2.869-1.252 4.416-.07 2.01.477 3.954 1.583 5.625 1.082 1.633 2.61 2.882 4.42 3.611l.236.095.071.025.003-.001a9.59 9.59 0 0 0 2.941.568q.171.006.342.006c1.273 0 2.513-.249 3.69-.742l.008.004.313-.145a9.63 9.63 0 0 0 3.927-3.335c1.01-1.49 1.577-3.234 1.641-5.042.075-2.161-.643-4.304-2.133-6.371m-7.083 6.695c.328 1.244.264 2.44-.191 3.558-1.135-1.12-1.967-2.352-2.475-3.665-.543-1.404-.87-2.74-.974-3.975.48.157.922.366 1.315.622 1.132.737 1.914 1.902 2.325 3.461zm.207 6.022c.482.368.99.712 1.513 1.028-.771.21-1.565.302-2.369.273a8 8 0 0 1-.373-.022c.458-.394.869-.823 1.228-1.279zm1.347-6.431c-.516-1.957-1.527-3.437-3.002-4.398-.647-.421-1.385-.741-2.194-.95.011-.134.026-.268.043-.4.014-.113.03-.216.046-.313.133-.689.332-1.37.589-2.025.099-.25.206-.499.321-.74l.004-.008c.177-.358.376-.719.61-1.105l.092-.152-.003-.001c.544-.851 1.197-1.627 1.942-2.311l.288.341c.672.796 1.304 1.548 1.878 2.237 1.291 1.549 2.966 3.583 3.612 4.48 1.277 1.771 1.893 3.579 1.83 5.375-.049 1.395-.461 2.755-1.195 3.933-.694 1.116-1.661 2.05-2.8 2.708-.636-.318-1.559-.839-2.539-1.599.79-1.575.952-3.28.479-5.072zm-2.575 5.397c-.725.939-1.587 1.55-2.09 1.856-.081-.029-.163-.06-.243-.093l-.065-.026c-1.49-.616-2.747-1.656-3.635-3.01-.907-1.384-1.356-2.993-1.298-4.653.041-1.19.338-2.327.882-3.379.316-.07.638-.114.96-.131l.084-.002c.162-.003.324-.003.478 0 .227.011.454.035.677.07.073 1.513.445 3.145 1.105 4.852.637 1.644 1.694 3.162 3.144 4.515z"},bun:{hex:"000000",path:"M12 22.596c6.628 0 12-4.338 12-9.688 0-3.318-2.057-6.248-5.219-7.986-1.286-.715-2.297-1.357-3.139-1.89C14.058 2.025 13.08 1.404 12 1.404c-1.097 0-2.334.785-3.966 1.821a49.92 49.92 0 0 1-2.816 1.697C2.057 6.66 0 9.59 0 12.908c0 5.35 5.372 9.687 12 9.687v.001ZM10.599 4.715c.334-.759.503-1.58.498-2.409 0-.145.202-.187.23-.029.658 2.783-.902 4.162-2.057 4.624-.124.048-.199-.121-.103-.209a5.763 5.763 0 0 0 1.432-1.977Zm2.058-.102a5.82 5.82 0 0 0-.782-2.306v-.016c-.069-.123.086-.263.185-.172 1.962 2.111 1.307 4.067.556 5.051-.082.103-.23-.003-.189-.126a5.85 5.85 0 0 0 .23-2.431Zm1.776-.561a5.727 5.727 0 0 0-1.612-1.806v-.014c-.112-.085-.024-.274.114-.218 2.595 1.087 2.774 3.18 2.459 4.407a.116.116 0 0 1-.049.071.11.11 0 0 1-.153-.026.122.122 0 0 1-.022-.083 5.891 5.891 0 0 0-.737-2.331Zm-5.087.561c-.617.546-1.282.76-2.063 1-.117 0-.195-.078-.156-.181 1.752-.909 2.376-1.649 2.999-2.778 0 0 .155-.118.188.085 0 .304-.349 1.329-.968 1.874Zm4.945 11.237a2.957 2.957 0 0 1-.937 1.553c-.346.346-.8.565-1.286.62a2.178 2.178 0 0 1-1.327-.62 2.955 2.955 0 0 1-.925-1.553.244.244 0 0 1 .064-.198.234.234 0 0 1 .193-.069h3.965a.226.226 0 0 1 .19.07c.05.053.073.125.063.197Zm-5.458-2.176a1.862 1.862 0 0 1-2.384-.245 1.98 1.98 0 0 1-.233-2.447c.207-.319.503-.566.848-.713a1.84 1.84 0 0 1 1.092-.11c.366.075.703.261.967.531a1.98 1.98 0 0 1 .408 2.114 1.931 1.931 0 0 1-.698.869v.001Zm8.495.005a1.86 1.86 0 0 1-2.381-.253 1.964 1.964 0 0 1-.547-1.366c0-.384.11-.76.32-1.079.207-.319.503-.567.849-.713a1.844 1.844 0 0 1 1.093-.108c.367.076.704.262.968.534a1.98 1.98 0 0 1 .4 2.117 1.932 1.932 0 0 1-.702.868Z"},deno:{hex:"70FFAF",path:"M1.105 18.02A11.9 11.9 0 0 1 0 12.985q0-.698.078-1.376a12 12 0 0 1 .231-1.34A12 12 0 0 1 4.025 4.02a12 12 0 0 1 5.46-2.771 12 12 0 0 1 3.428-.23c1.452.112 2.825.477 4.077 1.05a12 12 0 0 1 2.78 1.774 12.02 12.02 0 0 1 4.053 7.078A12 12 0 0 1 24 12.985q0 .454-.036.914a12 12 0 0 1-.728 3.305 12 12 0 0 1-2.38 3.875c-1.33 1.357-3.02 1.962-4.43 1.936a4.4 4.4 0 0 1-2.724-1.024c-.99-.853-1.391-1.83-1.53-2.919a5 5 0 0 1 .128-1.518c.105-.38.37-1.116.76-1.437-.455-.197-1.04-.624-1.226-.829-.045-.05-.04-.13 0-.183a.155.155 0 0 1 .177-.053c.392.134.869.267 1.372.35.66.111 1.484.25 2.317.292 2.03.1 4.153-.813 4.812-2.627s.403-3.609-1.96-4.685-3.454-2.356-5.363-3.128c-1.247-.505-2.636-.205-4.06.582-3.838 2.121-7.277 8.822-5.69 15.032a.191.191 0 0 1-.315.19 12 12 0 0 1-1.25-1.634 12 12 0 0 1-.769-1.404M11.57 6.087c.649-.051 1.214.501 1.31 1.236.13.979-.228 1.99-1.41 2.013-1.01.02-1.315-.997-1.248-1.614.066-.616.574-1.575 1.35-1.635"},nuxt:{hex:"00DC82",path:"M13.4642 19.8295h8.9218c.2834 0 .5618-.0723.8072-.2098a1.5899 1.5899 0 0 0 .5908-.5732 1.5293 1.5293 0 0 0 .216-.783 1.529 1.529 0 0 0-.2167-.7828L17.7916 7.4142a1.5904 1.5904 0 0 0-.5907-.573 1.6524 1.6524 0 0 0-.807-.2099c-.2833 0-.5616.0724-.807.2098a1.5904 1.5904 0 0 0-.5907.5731L13.4642 9.99l-2.9954-5.0366a1.5913 1.5913 0 0 0-.591-.573 1.6533 1.6533 0 0 0-.8071-.2098c-.2834 0-.5617.0723-.8072.2097a1.5913 1.5913 0 0 0-.591.573L.2168 17.4808A1.5292 1.5292 0 0 0 0 18.2635c-.0001.2749.0744.545.216.783a1.59 1.59 0 0 0 .5908.5732c.2454.1375.5238.2098.8072.2098h5.6003c2.219 0 3.8554-.9454 4.9813-2.7899l2.7337-4.5922L16.3935 9.99l4.3944 7.382h-5.8586ZM7.123 17.3694l-3.9083-.0009 5.8586-9.8421 2.9232 4.921-1.9572 3.2892c-.7478 1.1967-1.5972 1.6328-2.9163 1.6328z"},stripe:{hex:"635BFF",path:"M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z"},twilio:{hex:"F22F46",path:"M12 0C5.381-.008.008 5.352 0 11.971V12c0 6.64 5.359 12 12 12 6.64 0 12-5.36 12-12 0-6.641-5.36-12-12-12zm0 20.801c-4.846.015-8.786-3.904-8.801-8.75V12c-.014-4.846 3.904-8.786 8.75-8.801H12c4.847-.014 8.786 3.904 8.801 8.75V12c.015 4.847-3.904 8.786-8.75 8.801H12zm5.44-11.76c0 1.359-1.12 2.479-2.481 2.479-1.366-.007-2.472-1.113-2.479-2.479 0-1.361 1.12-2.481 2.479-2.481 1.361 0 2.481 1.12 2.481 2.481zm0 5.919c0 1.36-1.12 2.48-2.481 2.48-1.367-.008-2.473-1.114-2.479-2.48 0-1.359 1.12-2.479 2.479-2.479 1.361-.001 2.481 1.12 2.481 2.479zm-5.919 0c0 1.36-1.12 2.48-2.479 2.48-1.368-.007-2.475-1.113-2.481-2.48 0-1.359 1.12-2.479 2.481-2.479 1.358-.001 2.479 1.12 2.479 2.479zm0-5.919c0 1.359-1.12 2.479-2.479 2.479-1.367-.007-2.475-1.112-2.481-2.479 0-1.361 1.12-2.481 2.481-2.481 1.358 0 2.479 1.12 2.479 2.481z"},reactquery:{hex:"FF4154",path:"M6.9297 13.6875c.164-.0938.375-.0352.4687.1328l.0625.1055c.4805.8515.9805 1.6601 1.5 2.4258.6133.9023 1.3047 1.8164 2.0743 2.7421a.3455.3455 0 0 1-.0391.4844l-.0742.0664c-2.543 2.2227-4.1914 2.664-4.9532 1.332-.746-1.3046-.4765-3.6718.8086-7.1093a.3437.3437 0 0 1 .1524-.1797ZM17.75 16.3008c.1836-.0313.3594.086.3945.2695l.0196.1016c.6289 3.2851.1875 4.9297-1.3243 4.9297-1.4804 0-3.3593-1.4024-5.6484-4.2032a.3271.3271 0 0 1-.0742-.2226c0-.1875.1562-.3399.3437-.3399h.1211a32.9838 32.9838 0 0 0 2.8086-.0976c1.0703-.086 2.1914-.2305 3.3594-.4375zm.871-6.9766a.3528.3528 0 0 1 .4454-.211l.1016.0352c3.2617 1.1094 4.5039 2.332 3.7187 3.6641-.7656 1.3047-2.9922 2.254-6.6836 2.8477-.082.0117-.168-.004-.2383-.047-.168-.0976-.2265-.3085-.125-.4765l.0625-.1054c.504-.8438.957-1.6836 1.3672-2.5235.4766-.9883.9297-2.0508 1.3516-3.1836zM7.797 8.3398c.082-.0117.168.004.2383.047.168.0976.2265.3085.125.4765l-.0625.1054a34.0882 34.0882 0 0 0-1.3672 2.5235c-.4766.9883-.9297 2.0508-1.3516 3.1836a.3528.3528 0 0 1-.4453.211l-.1016-.0352c-3.2617-1.1094-4.5039-2.332-3.7187-3.6641.7656-1.3047 2.9922-2.254 6.6836-2.8477Zm5.2812-3.9843c2.543-2.2227 4.1914-2.664 4.9532-1.332.746 1.3046.4765 3.6718-.8086 7.1093a.3436.3436 0 0 1-.1524.1797c-.164.0938-.375.0352-.4687-.1328l-.0625-.1055c-.4805-.8515-.9805-1.6601-1.5-2.4258-.6133-.9023-1.3047-1.8164-2.0743-2.7421a.3455.3455 0 0 1 .0391-.4844Zm-5.793-2.082c1.4805 0 3.3633 1.4023 5.6485 4.203a.3488.3488 0 0 1 .0781.2188c-.0039.1914-.1562.3438-.3476.3438l-.1172-.004a34.5835 34.5835 0 0 0-2.8086.1016c-1.0742.086-2.1953.2305-3.3633.4375a.343.343 0 0 1-.3945-.2734l-.0196-.0977c-.629-3.2851-.1876-4.9297 1.3242-4.9297Zm2.8711 5.8124h3.6875a.638.638 0 0 1 .5508.3164l1.8477 3.2188a.6437.6437 0 0 1 0 .6289l-1.8477 3.2227a.638.638 0 0 1-.5507.3164h-3.6875c-.2266 0-.4375-.1211-.547-.3164L7.7579 12.25a.6437.6437 0 0 1 0-.629l1.8516-3.2187c.1093-.1953.3203-.3164.5468-.3164Zm3.2305.793a.638.638 0 0 1 .5508.3164l1.3906 2.4258a.6437.6437 0 0 1 0 .6289l-1.3906 2.4297a.638.638 0 0 1-.5508.3164h-2.7734c-.2266 0-.4375-.1211-.5469-.3164L8.672 12.25a.6437.6437 0 0 1 0-.629l1.3945-2.4257c.1094-.1953.3203-.3164.5469-.3164Zm-.4922.8672h-1.789c-.2266 0-.4336.1172-.547.3164l-.8983 1.5586a.6437.6437 0 0 0 0 .6289l.8984 1.5625a.6317.6317 0 0 0 .5469.3164h1.789a.6317.6317 0 0 0 .547-.3164l.8983-1.5625a.6437.6437 0 0 0 0-.629l-.8984-1.5585c-.1133-.1992-.3203-.3164-.5469-.3164Zm-.4765.8281c.2265 0 .4375.1211.5468.3164l.422.7305c.1132.1953.1132.4375 0 .6289l-.422.7344c-.1093.1953-.3203.3164-.5468.3164h-.836a.6317.6317 0 0 1-.5468-.3164l-.422-.7344c-.1132-.1914-.1132-.4336 0-.629l.422-.7304a.6317.6317 0 0 1 .5468-.3164zm-.418.8164a.548.548 0 0 0-.4727.2735c-.0976.168-.0976.375 0 .5468a.5444.5444 0 0 0 .4727.2696.5444.5444 0 0 0 .4727-.2696c.0976-.1718.0976-.3789 0-.5468A.548.548 0 0 0 12 11.3906Zm-4.4219.5469h.9805M18.9805 7.75c.3906-1.8945.4765-3.3438.2226-4.3984-.1484-.629-.4218-1.1368-.8398-1.5078-.4414-.3907-1-.582-1.625-.582-1.0352 0-2.1211.4726-3.2813 1.3671-.4726.3633-.9648.8047-1.4726 1.3164-.043-.0508-.086-.1015-.1367-.1445-1.4454-1.2852-2.6602-2.082-3.6993-2.3906-.6171-.1836-1.1953-.1993-1.7226-.0235-.5586.1875-1.004.5742-1.3164 1.1172-.5156.8945-.6524 2.0742-.461 3.5274.0782.5898.2149 1.2343.4024 1.9335a1.1187 1.1187 0 0 0-.2149.047C3.008 8.621 1.711 9.2694.9258 10.0155c-.4649.4414-.7695.9375-.8828 1.4805-.1133.5781 0 1.1562.3125 1.6992.5156.8945 1.4648 1.5977 2.8164 2.1563.543.2226 1.1562.4257 1.8437.6093a1.0227 1.0227 0 0 0-.0703.2266c-.3906 1.8906-.4765 3.3438-.2226 4.3945.1484.629.4257 1.1407.8398 1.5078.4414.3907 1 .582 1.625.582 1.0352 0 2.121-.4726 3.2813-1.3632.4765-.3711.9726-.8164 1.4882-1.336a1.2 1.2 0 0 0 .1953.2266c1.4454 1.2852 2.6602 2.082 3.6993 2.3906.6172.1836 1.1953.1993 1.7226.0235.5586-.1875 1.004-.5742 1.3164-1.1172.5157-.8945.6524-2.0742.461-3.5273-.082-.6133-.2227-1.2813-.4258-2.0118a1.2248 1.2248 0 0 0 .2383-.0468c1.828-.6094 3.125-1.2578 3.9101-2.004.4649-.4413.7696-.9374.8828-1.4804.1133-.5781 0-1.1563-.3125-1.6992-.5156-.8946-1.4648-1.5977-2.8164-2.1563-.5586-.2304-1.1953-.4414-1.9062-.625a.8647.8647 0 0 0 .0586-.1953z"},reacthookform:{hex:"EC5990",path:"M10.7754 17.3477H5.8065a.2815.2815 0 1 0 0 .563h4.9689a.2815.2815 0 1 0 0-.563zm7.3195 0h-4.9688a.2815.2815 0 1 0 0 .563h4.9688a.2815.2815 0 0 0 0-.563zm-7.3336-6.475H5.8065a.2815.2815 0 1 0 0 .563h4.9548a.2815.2815 0 1 0 0-.563zm7.3195 0h-4.9547a.2815.2815 0 1 0 0 .563h4.9547a.2815.2815 0 0 0 0-.563zm.5518-9.2001h-4.341a2.4042 2.4042 0 0 0-4.5804 0H5.3674c-1.7103 0-3.0968 1.3864-3.0968 3.0967v16.134C2.2706 22.6135 3.6571 24 5.3674 24h13.2652c1.7103 0 3.0968-1.3865 3.0968-3.0967V4.7693c0-1.7103-1.3865-3.0967-3.0968-3.0967zm-8.7046.563a.2815.2815 0 0 0 .2815-.2224 1.8411 1.8411 0 0 1 3.5979 0 .2815.2815 0 0 0 .2815.2224h1.5146v1.844a.8446.8446 0 0 1-.8446.8446H9.2552a.8446.8446 0 0 1-.8446-.8446v-1.844Zm11.2383 18.6677c0 1.3993-1.1344 2.5337-2.5337 2.5337H5.3674c-1.3993 0-2.5337-1.1344-2.5337-2.5337V4.7693c0-1.3993 1.1344-2.5337 2.5337-2.5337h2.4802v1.844c0 .7774.6302 1.4076 1.4076 1.4076h5.4896c.7774 0 1.4076-.6302 1.4076-1.4076v-1.844h2.4802c1.3993 0 2.5337 1.1344 2.5337 2.5337z"},git:{hex:"F03C2E",path:"M13.09 23.549a1.54 1.54 0 0 1-2.18 0L.451 13.089a1.54 1.54 0 0 1 0-2.179l7.191-7.19 2.733 2.733a1.85 1.85 0 0 0 .964 2.326v6.66a1.849 1.849 0 1 0 1.54 0V8.957l2.508 2.508a1.85 1.85 0 1 0 1.09-1.09l-2.634-2.634a1.85 1.85 0 0 0-2.378-2.377L8.73 2.63 10.91.451a1.54 1.54 0 0 1 2.179 0l10.459 10.46a1.54 1.54 0 0 1 0 2.179z"},flutter:{hex:"02569B",path:"M14.314 0L2.3 12 6 15.7 21.684.013h-7.357zm.014 11.072L7.857 17.53l6.47 6.47H21.7l-6.46-6.468 6.46-6.46h-7.37z"},xcode:{hex:"147EFB",path:"M19.06 5.3327c.4517-.1936.7744-.2581 1.097-.1936.5163.1291.7744.5163.968.7098.1936.3872.9034.7744 1.2261.8389.2581.0645.7098-.6453 1.0325-1.2906.3227-.5808.5163-1.3552.4517-1.5488-.0645-.1936-.968-.5808-1.1616-.5808-.1291 0-.3872.1291-.8389.0645-.4517-.0645-.9034-.5808-1.1616-.968-.4517-.6453-1.097-1.0325-1.6778-1.3552-.6453-.3227-1.3552-.5163-2.065-.6453-1.0325-.2581-2.065-.4517-3.0975-.3227-.5808.0645-1.2906.1291-1.8069.3227-.0645 0-.1936.1936-.0645.1936s.5808.0645.5808.0645-.5807.1292-.5807.2583c0 .1291.0645.1291.1291.1291.0645 0 1.4842-.0645 2.065 0 .6453.1291 1.3552.4517 1.8069 1.2261.7744 1.4197.4517 2.7749.2581 3.2266-.968 2.1295-8.6472 15.2294-9.0344 16.1328-.3873.9034-.5163 1.4842.5807 2.065s1.6778.3227 2.0005-.0645c.3872-.5163 7.0339-17.1654 9.2925-18.2624zm-3.6138 8.7117h1.5488c1.0325 0 1.2261.5163 1.2261.7098.0645.5163-.1936 1.1616-1.2261 1.1616h-.968l.7744 1.2906c.4517.7744.2581 1.1616 0 1.4197-.3872.3872-1.2261.3872-1.6778-.4517l-.9034-1.5488c-.6453 1.4197-1.2906 2.9684-2.065 4.7753h4.0009c1.9359 0 3.5492-1.6133 3.5492-3.5492V6.5588c-.0645-.1291-.1936-.0645-.2581 0-.3872.4517-1.4842 2.0004-4.001 7.4856zm-9.8087 8.0019h-.3227c-2.3231 0-4.1945-1.8714-4.1945-4.1945V7.0105c0-2.3231 1.8714-4.1945 4.1945-4.1945h9.3571c-.1936-.1936-.968-.5163-1.7423-.4517-.3227 0-.968.1291-1.3552-.1291-.3872-.3227-.3227-.5163-.9034-.5163H4.9277c-2.6458 0-4.7753 2.1295-4.7753 4.7753v11.7447c0 2.6458 2.1295 4.7753 4.4527 4.7108.6452 0 .8388-.5162 1.0324-.9034zM20.4152 6.9459v10.9058c0 2.3231-1.8714 4.1945-4.1945 4.1945H11.897s-.3872 1.0325.8389 1.0325h3.8719c2.6458 0 4.7753-2.1295 4.7753-4.7753V8.8173c.0646-.9034-.7098-1.4842-.9679-1.8714zm-18.5851.0646v10.8413c0 1.9359 1.6133 3.5492 3.5492 3.5492h.5808c0-.0645.7744-1.4197 2.4522-4.2591.1936-.3872.4517-.7744.7098-1.2261H4.4114c-.5808 0-.9034-.3872-.968-.7098-.1291-.5163.1936-1.1616.9034-1.1616h2.3877l3.033-5.2916s-.7098-1.2906-.9034-1.6133c-.2582-.4517-.1291-.9034.129-1.1615.3872-.3872 1.0325-.5808 1.6778.4517l.2581.3872.2581-.3872c.5808-.8389.968-.7744 1.2906-.7098.5163.1291.8389.7098.3872 1.6133L8.864 14.0444h1.3552c.4517-.7744.9034-1.5488 1.3552-2.3877-.0645-.3227-.1291-.7098-.0645-1.0325.0645-.5163.3227-.968.6453-1.3552l.3872.6453c1.2261-2.1295 2.1295-3.9364 2.3877-4.6463.1291-.3872.3227-1.1616.1291-1.8069H5.3794c-2.0005.0001-3.5493 1.6134-3.5493 3.5494zM4.605 17.7872c0-.0645.7744-1.4197.7744-1.4197 1.2261-.3227 1.8069.4517 1.8714.5163 0 0-.8389 1.4842-1.097 1.7423s-.5808.3227-.9034.2581c-.5164-.129-.839-.6453-.6454-1.097z"},apple:{hex:"000000",path:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"},cocoapods:{hex:"EE3322",path:"M8.812 17.176c-2.968 0-4.956-2.308-4.956-5.176 0-2.705 1.776-5.176 4.91-5.176 2.407 0 3.856 1.445 4.207 3.357h3.95C16.479 6.427 13.51 3.42 8.718 3.42 3.131 3.42 0 7.523 0 12c0 4.57 3.295 8.58 8.766 8.58 4.58 0 7.549-2.822 8.18-6.272h-4.02c-.467 1.609-1.916 2.868-4.114 2.868zM24 12.068l-3.466 8.055-2.38-1.022 2.992-7.055-3.01-7.096 2.433-1.042Z"},openjdk:{hex:"000000",path:"M11.915 0 11.7.215C9.515 2.4 7.47 6.39 6.046 10.483c-1.064 1.024-3.633 2.81-3.711 3.551-.093.87 1.746 2.611 1.55 3.235-.198.625-1.304 1.408-1.014 1.939.1.188.823.011 1.277-.491a13.389 13.389 0 0 0-.017 2.14c.076.906.27 1.668.643 2.232.372.563.956.911 1.667.911.397 0 .727-.114 1.024-.264.298-.149.571-.33.91-.5.68-.34 1.634-.666 3.53-.604 1.903.062 2.872.39 3.559.704.687.314 1.15.664 1.925.664.767 0 1.395-.336 1.807-.9.412-.563.631-1.33.72-2.24.06-.623.055-1.32 0-2.066.454.45 1.117.604 1.213.424.29-.53-.816-1.314-1.013-1.937-.198-.624 1.642-2.366 1.549-3.236-.08-.748-2.707-2.568-3.748-3.586C16.428 6.374 14.308 2.394 12.13.215zm.175 6.038a2.95 2.95 0 0 1 2.943 2.942 2.95 2.95 0 0 1-2.943 2.943A2.95 2.95 0 0 1 9.148 8.98a2.95 2.95 0 0 1 2.942-2.942zM8.685 7.983a3.515 3.515 0 0 0-.145.997c0 1.951 1.6 3.55 3.55 3.55 1.95 0 3.55-1.598 3.55-3.55 0-.329-.046-.648-.132-.951.334.095.64.208.915.336a42.699 42.699 0 0 1 2.042 5.829c.678 2.545 1.01 4.92.846 6.607-.082.844-.29 1.51-.606 1.94-.315.431-.713.651-1.315.651-.593 0-.932-.27-1.673-.61-.741-.338-1.825-.694-3.792-.758-1.974-.064-3.073.293-3.821.669-.375.188-.659.373-.911.5s-.466.2-.752.2c-.53 0-.876-.209-1.16-.64-.285-.43-.474-1.101-.545-1.948-.141-1.693.176-4.069.823-6.614a43.155 43.155 0 0 1 1.934-5.783c.348-.167.749-.31 1.192-.425zm-3.382 4.362a.216.216 0 0 1 .13.031c-.166.56-.323 1.116-.463 1.665a33.849 33.849 0 0 0-.547 2.555 3.9 3.9 0 0 0-.2-.39c-.58-1.012-.914-1.642-1.16-2.08.315-.24 1.679-1.755 2.24-1.781zm13.394.01c.562.027 1.926 1.543 2.24 1.783-.246.438-.58 1.068-1.16 2.08a4.428 4.428 0 0 0-.163.309 32.354 32.354 0 0 0-.562-2.49 40.579 40.579 0 0 0-.482-1.652.216.216 0 0 1 .127-.03z"},android:{hex:"34A853",path:"M18.4395 5.5586c-.675 1.1664-1.352 2.3318-2.0274 3.498-.0366-.0155-.0742-.0286-.1113-.043-1.8249-.6957-3.484-.8-4.42-.787-1.8551.0185-3.3544.4643-4.2597.8203-.084.0338-.1673.0707-.25.1075L5.5996 5.5586a.4.4 0 0 0-.5524-.1494.4.4 0 0 0-.1494.5524l1.9727 3.4092C3.5165 11.2618 1.3125 14.5543 1 18.6094h22c-.3125-4.0551-2.5165-7.3476-5.8711-9.2385l1.9727-3.4092a.4.4 0 0 0-.1494-.5524.4.4 0 0 0-.5127.1494zM6.9785 14.5273a1.0016 1.0016 0 0 1 1 1.002 1.0016 1.0016 0 0 1-1 1 1.0016 1.0016 0 0 1-1.002-1 1.0016 1.0016 0 0 1 1.002-1.002zm10.0352 0a1.0016 1.0016 0 0 1 1.0019 1.002 1.0016 1.0016 0 0 1-1.0019 1 1.0016 1.0016 0 0 1-1-1 1.0016 1.0016 0 0 1 1-1.002z"},androidstudio:{hex:"3DDC84",path:"M19.2693 10.3368c-.3321 0-.6026.2705-.6026.6031v9.8324h-1.7379l-3.3355-6.9396c.476-.5387.6797-1.286.5243-2.0009a2.2862 2.2862 0 0 0-1.2893-1.6248v-.8124c.0121-.2871-.1426-.5787-.4043-.7407-.1391-.0825-.2884-.1234-.4402-.1234a.8478.8478 0 0 0-.4318.1182c-.2701.1671-.4248.4587-.4123.7662l-.0003.721c-1.0149.3668-1.6619 1.4153-1.4867 2.5197a2.282 2.282 0 0 0 .5916 1.2103l-3.2096 6.9064H4.0928c-1.0949-.007-1.9797-.8948-1.9832-1.9896V5.016c-.0055 1.1024.8836 2.0006 1.9859 2.0062a2.024 2.024 0 0 0 .1326-.0037h14.7453s2.5343-.2189 2.8619 1.5392c-.2491.0287-.4449.2321-.4449.4889 0 .7115-.5791 1.2901-1.3028 1.2901h-.8183zM17.222 22.5366c.2347.4837.0329 1.066-.4507 1.3007-.1296.0629-.2666.0895-.4018.0927a.9738.9738 0 0 1-.3194-.0455c-.024-.0078-.046-.0209-.0694-.0305a.9701.9701 0 0 1-.2277-.1321c-.0247-.0192-.0495-.038-.0724-.0598-.0825-.0783-.1574-.1672-.21-.2757l-1.2554-2.6143-1.5585-3.2452a.7725.7725 0 0 0-.6995-.4443h-.0024a.792.792 0 0 0-.7083.4443l-1.5109 3.2452-1.2321 2.6464a.9722.9722 0 0 1-.7985.5795c-.0626.0053-.1238-.0024-.185-.0087-.0344-.0036-.069-.0053-.1025-.0124-.0489-.0103-.0954-.0278-.142-.0452-.0301-.0113-.0613-.0197-.0901-.0339-.0496-.0244-.0948-.0565-.1397-.0889-.0217-.0156-.0457-.0275-.0662-.045a.9862.9862 0 0 1-.1695-.1844.9788.9788 0 0 1-.0708-.9852l.8469-1.8223 3.2676-7.0314a1.7964 1.7964 0 0 1-.7072-1.1637c-.1555-.9799.5129-1.9003 1.4928-2.0559V9.3946a.3542.3542 0 0 1 .1674-.3155.3468.3468 0 0 1 .3541 0 .354.354 0 0 1 .1674.3155v1.159l.0129.0064a1.8028 1.8028 0 0 1 1.2878 1.378 1.7835 1.7835 0 0 1-.6439 1.7836l3.3889 7.0507.8481 1.7643zM12.9841 12.306c.0042-.6081-.4854-1.1044-1.0935-1.1085a1.1204 1.1204 0 0 0-.7856.3219 1.101 1.101 0 0 0-.323.7716c-.0042.6081.4854 1.1044 1.0935 1.1085h.0077c.6046 0 1.0967-.488 1.1009-1.0935zm-1.027 5.2768c-.1119.0005-.2121.0632-.2571.1553l-1.4127 3.0342h3.3733l-1.4564-3.0328a.274.274 0 0 0-.2471-.1567zm8.1432-6.7459l-.0129-.0001h-.8177a.103.103 0 0 0-.103.103v12.9103a.103.103 0 0 0 .0966.103h.8435c.9861-.0035 1.7836-.804 1.7836-1.79V9.0468c0 .9887-.8014 1.7901-1.7901 1.7901zM2.6098 5.0161v.019c.0039.816.6719 1.483 1.4874 1.4869a12.061 12.061 0 0 1 .1309-.0034h1.1286c.1972-1.315.7607-2.525 1.638-3.4859H4.0993c-.9266.0031-1.6971.6401-1.9191 1.4975.2417.0355.4296.235.4296.4859zm6.3381-2.8977L7.9112.3284a.219.219 0 0 1 0-.2189A.2384.2384 0 0 1 8.098 0a.219.219 0 0 1 .1867.1094l1.0496 1.8158a6.4907 6.4907 0 0 1 5.3186 0L15.696.1094a.2189.2189 0 0 1 .3734.2189l-1.0302 1.79c1.6671.9125 2.7974 2.5439 3.0975 4.4018l-12.286-.0014c.3004-1.8572 1.4305-3.488 3.0972-4.4003zm5.3774 2.6202a.515.515 0 0 0 .5271.5028.515.515 0 0 0 .5151-.5151.5213.5213 0 0 0-.8885-.367.5151.5151 0 0 0-.1537.3793zm-5.7178-.0067a.5151.5151 0 0 0 .5207.5095.5086.5086 0 0 0 .367-.1481.5215.5215 0 1 0-.734-.7341.515.515 0 0 0-.1537.3727z"},claude:{hex:"D97757",path:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"},googlegemini:{hex:"8E75B2",path:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"},cursor:{hex:"000000",path:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"},githubcopilot:{hex:"000000",path:"M23.922 16.997C23.061 18.492 18.063 22.02 12 22.02 5.937 22.02.939 18.492.078 16.997A.641.641 0 0 1 0 16.741v-2.869a.883.883 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.098 10.098 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952C7.255 2.937 9.248 1.98 11.978 1.98c2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.841.841 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256Zm-11.75-5.992h-.344a4.359 4.359 0 0 1-.355.508c-.77.947-1.918 1.492-3.508 1.492-1.725 0-2.989-.359-3.782-1.259a2.137 2.137 0 0 1-.085-.104L4 11.746v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.359 4.359 0 0 1-.355-.508Zm2.328 3.25c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm-5 0c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm3.313-6.185c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"}};function qO(e){const n=parseInt(e,16);return(n>>16&255)*.299+(n>>8&255)*.587+(n&255)*.114<60}const IO={git:"git",flutter:"flutter",xcode:"xcode",simulator:"apple",cocoapods:"cocoapods",java:"openjdk",android:"android","android-studio":"androidstudio",docker:"docker"},FO=[[/claude/i,"claude"],[/gemini/i,"googlegemini"],[/cursor/i,"cursor"],[/copilot/i,"githubcopilot"]],e5={maestro:{hex:"7B61FF",Icon:pS},"ai-tool":{hex:"0D8A42",Icon:U9}};function t5(e,n){const s=e==="ai-tool"?FO.find(([r])=>r.test(n))?.[1]:IO[e];return s?J4[s]:void 0}function n5(e,n){return`#${s5(e,n)}`}const s5=(e,n)=>t5(e,n)?.hex??e5[e]?.hex??"536159";function LO(e){const n=parseInt(e,16);return(n>>16&255)*.299+(n>>8&255)*.587+(n&255)*.114>150}function Rg({id:e,name:n,size:s=42}){const r=t5(e,n),i=e5[e],a={"--brand":n5(e,n),"--size":`${s}px`};return t.jsx("span",{className:`tl-logo ${LO(s5(e,n))?"light":""}`,style:a,"aria-hidden":"true",children:r?t.jsx("svg",{viewBox:"0 0 24 24",className:"tl-glyph",children:t.jsx("path",{d:r.path})}):i?t.jsx(i.Icon,{strokeWidth:2.2}):t.jsx("b",{children:n.slice(0,2)})})}const r5={build:"Building",checks:"Checks",pictures:"Phone pictures","start-app":"Start","try-it":"Try it yourself"},zO={build:"build stories",checks:"run the checks",pictures:"take phone pictures","start-app":"start the app on the phone","try-it":"let you try the app on the phone"},MO=[{priority:"required",title:"Required",sub:"Without these, some steps cannot run. squad-kit stops only those steps."},{priority:"recommended",title:"Recommended",sub:"Things work without these, in a simpler way. With them, the experience is better."},{priority:"optional",title:"Optional",sub:"Nice to have."}];function i5(e=3e4){return ve({queryKey:["tools"],queryFn:()=>ye("/api/v1/tools"),refetchInterval:n=>n.state.data?.getting||n.state.data?.checking?1e3:e})}function OO(e){switch(e.state){case"ready":return e.version?`Ready · ${e.version}`:"Ready";case"too-old":return`Too old: found ${e.version??"an old one"}, needs ${e.needs} or newer`;case"getting":return"Getting it now";case"updating":return"Updating now";case"not-here":return"Not on this computer";default:return"Missing"}}const Mf=e=>e.state==="ready"?"ok":e.state==="getting"||e.state==="updating"?"get":e.state==="not-here"?"off":"needs";function a5({l:e,size:n=13}){return e.state==="ready"?t.jsx(ce,{size:n,strokeWidth:3,"aria-hidden":"true"}):e.state==="getting"||e.state==="updating"?t.jsx(Xe,{size:n,className:"spin","aria-hidden":"true"}):e.state==="not-here"?t.jsx(Ra,{size:n,strokeWidth:3,"aria-hidden":"true"}):t.jsx(Fn,{size:n,strokeWidth:2.5,"aria-hidden":"true"})}const _O={ready:"Ready","too-old":"Too old",missing:"Missing",getting:"Getting it",updating:"Updating","not-here":"Not here"},DO=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`;function BO(e){const n=DO(e.blocks.map(r=>zO[r]??r5[r]??r)),s=e.state==="too-old"||e.state==="updating";return!s&&e.installer==="squad-kit"?`Until squad-kit gets ${e.name}, it can't ${n}. Everything else works.`:`Until ${e.name} is ${s?"updated":"installed"}, squad-kit can't ${n}. Everything else works.`}function WO({lines:e}){return t.jsx("nav",{className:"tl-shelf","aria-label":"This project's tools",children:e.map(n=>t.jsxs(ge,{to:"/tools",hash:n.id,className:`tl-chip ${Mf(n)}`,children:[t.jsxs("span",{className:"tl-chip-art",children:[t.jsx(Rg,{id:n.id,name:n.name,size:46}),t.jsx("span",{className:"tl-badge",children:t.jsx(a5,{l:n,size:11})})]}),t.jsx("b",{children:n.name}),t.jsx("span",{children:_O[n.state]})]},n.id))})}const xk=e=>e>=90?`about ${Math.round(e/60)} min left`:`about ${e} s left`;function UO({g:e}){const n=e.total?Math.min(99,Math.floor(e.done/e.total*100)):null,s=r=>Math.round(r/1024/1024);return t.jsxs("div",{className:"tl-get","aria-live":"polite",children:[t.jsx("div",{className:"tl-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n??void 0,children:t.jsx("i",{style:{width:`${e.step==="unpack"?100:n??5}%`}})}),e.step==="update"?t.jsxs("span",{children:[e.words??"Updating",", ",xk(e.secondsLeft),". Steps that need ",e.name," wait until it is done; everything else keeps working."]}):t.jsxs("span",{children:[e.step==="unpack"?"Unpacking":`${e.step==="install"?e.words??"Installing":"Downloading"}${e.total?`: ${s(e.done)} of ${s(e.total)} MB`:""}`,", ",xk(e.secondsLeft),". You can keep working meanwhile."]})]})}function HO({l:e,busy:n}){const s=re(),[r,i]=N.useState(!1),a=e.update;return r?t.jsx("div",{className:"tl-act",children:t.jsxs("div",{className:"tl-ask",role:"group","aria-label":`Update ${e.name} for all projects?`,children:[t.jsxs("p",{children:[t.jsx(Is,{size:15,strokeWidth:2.4,"aria-hidden":"true"}),t.jsx("span",{children:a.warning})]}),t.jsxs("span",{className:"tl-row",children:[t.jsxs("button",{className:"btn pri sm",disabled:n||s.isPending,onClick:()=>s.mutate({path:`/api/v1/tools/${encodeURIComponent(e.id)}/update`,body:{ok:!0},done:`Updating ${e.name}`,after:()=>i(!1)}),children:[s.isPending?t.jsx(Xe,{size:14,className:"spin"}):t.jsx(Sj,{size:14})," Update ",e.name," for all projects"]}),t.jsx("button",{className:"btn sm",autoFocus:!0,disabled:s.isPending,onClick:()=>i(!1),children:"Not now"})]})]})}):t.jsxs("div",{className:"tl-act",children:[t.jsx("span",{children:"squad-kit can update it for you."}),t.jsxs("span",{className:"tl-row",children:[t.jsxs("button",{className:"btn pri sm",disabled:n||s.isPending,onClick:()=>i(!0),children:[t.jsx(Sj,{size:14})," Update ",e.name]}),t.jsx(X,{text:a.command})]})]})}const KO=e=>e>=90?`about ${Math.round(e/60)} minutes`:`about ${Math.max(10,Math.round(e/10)*10)} seconds`;function VO({l:e,onClose:n}){const s=ve({queryKey:["tool-license",e.id],queryFn:()=>ye(`/api/v1/tools/${encodeURIComponent(e.id)}/license`),staleTime:36e5}),r=re(),i=s.data;return t.jsx(Ye,{title:`Google's license for the ${e.name}`,wide:!0,onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!i||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tools/${encodeURIComponent(e.id)}/accept`,body:{licenses:i.licenses.map(a=>a.id)},done:"You accepted Google's license. Now press Get it.",after:n}),children:[r.isPending?t.jsx(Xe,{size:15,className:"spin"}):t.jsx(ce,{size:15})," Accept"]}),t.jsx("button",{className:"btn",autoFocus:!0,onClick:n,children:"Not now"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:e.license.command})]}),children:i?t.jsxs(t.Fragment,{children:[t.jsxs("p",{children:["Google asks everyone who gets these tools to accept ",i.licenses.length===1?"this license":`these ${i.licenses.length} licenses`,". squad-kit never accepts ",i.licenses.length===1?"it":"them"," for you: read ",i.licenses.length===1?"it":"them",", then press Accept or Not now."]}),i.licenses.map(a=>t.jsxs("section",{className:"tl-license",children:[t.jsx("h4",{className:"mono",children:a.id}),t.jsx("pre",{children:a.text})]},a.id))]}):s.isError?t.jsx(ys,{what:"the license",error:s.error,onRetry:()=>void s.refetch()}):t.jsxs("p",{className:"tl-wait",children:[t.jsx(Xe,{size:15,className:"spin"})," Reading the license from Google's site…"]})})}function YO({l:e,hit:n,busy:s,onCheck:r}){const i=re(),[a,l]=N.useState(!1),c=e.state!=="ready"&&e.state!=="not-here"&&e.state!=="getting"&&e.state!=="updating",u=!!(e.license&&!e.license.accepted);return t.jsxs("section",{id:e.id,className:`tl-line ${Mf(e)} ${e.blocks.length?"stops":""} ${n?"tl-hit":""}`,style:{"--brand":n5(e.id,e.name)},children:[t.jsxs("div",{className:"tl-head",children:[t.jsx(Rg,{id:e.id,name:e.name}),t.jsxs("div",{className:"tl-name",children:[t.jsx("b",{children:e.name}),t.jsx("span",{children:e.gives})]}),t.jsxs("span",{className:`tl-state ${Mf(e)}`,children:[t.jsx(a5,{l:e})," ",OO(e)]})]}),t.jsxs("div",{className:"tl-body",children:[e.why&&e.state==="too-old"&&t.jsxs("p",{children:[e.why,"."]}),e.blocks.length>0&&t.jsxs("p",{className:"tl-stops",children:[t.jsx(Nl,{size:14,strokeWidth:2.6,"aria-hidden":"true"}),t.jsx("span",{children:BO(e)})]}),e.state==="not-here"&&e.notHere&&t.jsxs("p",{children:["It ",e.notHere,"."]}),t.jsxs("p",{className:"tl-uses",children:[t.jsx("span",{children:"Used for"}),e.actions.map(h=>t.jsx("i",{className:e.blocks.includes(h)?"stopped":"",title:e.blocks.includes(h)?"Waits for this tool":void 0,children:r5[h]},h))]}),e.note&&t.jsx("p",{children:e.note}),e.trouble&&t.jsx("p",{className:"tl-trouble",role:"alert",children:e.trouble}),e.getting&&t.jsx(UO,{g:e.getting}),c&&e.installer==="squad-kit"&&t.jsxs("div",{className:"tl-act",children:[t.jsxs("span",{children:["squad-kit gets it itself, into its own folder, with no password asked.",e.size?` It takes ${e.size} on this computer${e.seconds?`, and ${KO(e.seconds)} the first time`:""}.`:"",u?" Google's license comes first: read it and accept it.":""]}),u?t.jsxs("span",{className:"tl-row",children:[t.jsxs("button",{className:"btn pri sm",disabled:s,onClick:()=>l(!0),children:[t.jsx(Dr,{size:14})," Read and accept Google's license"]}),t.jsx(X,{text:e.license.command})]}):t.jsxs("span",{className:"tl-row",children:[t.jsxs("button",{className:"btn pri sm",disabled:s||i.isPending,onClick:()=>i.mutate({path:`/api/v1/tools/${encodeURIComponent(e.id)}/get`,done:`Getting ${e.name}`}),children:[t.jsx(gs,{size:14})," Get it"]}),t.jsx(X,{text:e.command})]}),a&&t.jsx(VO,{l:e,onClose:()=>l(!1)})]}),c&&e.update&&t.jsx(HO,{l:e,busy:s}),(c||e.recommended)&&e.installer==="you"&&t.jsxs("div",{className:"tl-act",children:[e.update?t.jsx("span",{className:"tl-or",children:"Or do it yourself:"}):e.cantUpdate?t.jsx("span",{children:e.cantUpdate}):e.reason&&t.jsxs("span",{children:["You ",e.recommended?"update":"install"," it: squad-kit can't, as ",e.reason,"."]}),e.steps.length>0&&t.jsx("ol",{children:e.steps.map(h=>t.jsx("li",{children:h},h))}),t.jsxs("span",{className:"tl-row",children:[t.jsxs("a",{className:"btn sm",href:e.link,target:"_blank",rel:"noreferrer",children:["Official page ",t.jsx(Xt,{size:13})]}),t.jsxs("button",{className:"btn sm",disabled:s,onClick:r,children:[t.jsx(xs,{size:13})," Check again"]}),t.jsx(X,{text:"squad tools check"})]})]})]})]})}function GO(){const e=i5(),n=re(),s=zr({select:l=>l.location.hash.replace(/^#/,"")}),r=e.data;N.useEffect(()=>{r&&s&&document.getElementById(s)?.scrollIntoView({block:"center",behavior:"smooth"})},[!!r,s]);const i=n.isPending||!!r?.checking,a=()=>n.mutate({path:"/api/v1/tools/check",done:"Checked this computer again"});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Tools"}),t.jsx("span",{className:"grow"}),t.jsxs(ge,{to:"/connections",className:"btn",children:[t.jsx(rb,{size:14})," Connections"]}),t.jsxs("button",{className:"btn",disabled:i,onClick:a,children:[i?t.jsx(Xe,{size:14,className:"spin"}):t.jsx(xs,{size:14})," Check again"]}),t.jsx(X,{text:"squad tools check"})]}),t.jsx("div",{className:"scroll",children:r?t.jsxs("div",{className:"page tl-page",children:[t.jsx("h2",{children:"What this project needs"}),t.jsxs("p",{className:"tl-sub",children:[r.summary," squad-kit checks this ",r.system==="mac"?"Mac":"computer"," by itself",r.checkedAt?`, last ${st(r.checkedAt)}`:"",". After you install something, press Check again."]}),t.jsx(WO,{lines:r.lines}),MO.map(l=>{const c=r.lines.filter(u=>u.priority===l.priority);return c.length?t.jsxs("div",{className:"tl-group",children:[t.jsx("h3",{children:l.title}),t.jsx("p",{className:"tl-gsub",children:l.sub}),c.map(u=>t.jsx(YO,{l:u,hit:s===u.id,busy:i,onCheck:a},u.id))]},l.priority):null})]}):e.isError?t.jsx(ys,{what:"the tools",error:e.error,onRetry:()=>void e.refetch()}):t.jsx("div",{className:"center",children:t.jsxs("span",{className:"tl-wait",children:[t.jsx(Xe,{size:16,className:"spin"})," Checking this computer's tools…"]})})})]})}const ia=e=>e?.split("/").pop()??"squad-kit",QO=(e,n,s)=>e===1?n:s.replace("{n}",String(e)),ZO={en:{title:"Contributing to squad-kit",sub:"squad-kit knows. We stay with you until the owner merges it.",steps:["Set up","Your idea","Built and checked","Pull request","Owner's review","Merged"],closed:"Closed by the owner",story:e=>`Following ${e}`},ar:{title:"تساهم في squad-kit",sub:"squad-kit عارف. ومعك خطوة بخطوة لين يدمجها المالك.",steps:["التجهيز","فكرتك","انبنت وانفحصت","طلب الدمج","مراجعة المالك","اندمجت"],closed:"سكّره المالك",story:e=>`نتابع ${e}`}},XO={en:{head:"You are contributing to squad-kit",sub:"squad-kit sets everything up for you. No git needed: each step has its button.",selfTitle:"squad-kit's own code",selfLine:"Your squad knows it, and works only in this folder.",read:"Read the rules",hide:"Hide the rules",readFile:"In your folder:",both:"Do both for me",go:"Write your first idea",left:e=>e===1?"One step left. squad-kit can do it now.":e===2?"Two steps left. squad-kit can do both now.":`${e} steps left.`,signFirst:"Sign in first, and squad-kit can do the rest.",ready:"Ready: your stories go as pull requests.",looking:"Looking at your copy…",notSelf:"This project is not squad-kit's own code, so it has no contribution checklist."},ar:{head:"أنت تساهم في squad-kit",sub:"squad-kit يجهّز لك كل شيء. ما تحتاج git: كل خطوة لها زر.",selfTitle:"كود squad-kit نفسه",selfLine:"الفريق يعرف ذلك، ويشتغل بس في هذا المجلد.",read:"اقرأ القواعد",hide:"أخفِ القواعد",readFile:"في مجلدك:",both:"سوّهم عني",go:"اكتب أول فكرة",left:e=>e===1?"باقي خطوة وحدة. squad-kit يقدر يسويها الآن.":e===2?"باقي خطوتين. squad-kit يقدر يسويهم الآن.":`باقي ${e} خطوات.`,signFirst:"سجّل الدخول أول، وsquad-kit يسوي الباقي.",ready:"جاهز: قصصك تروح كطلبات دمج.",looking:"نطالع نسختك…",notSelf:"هذا المشروع مو كود squad-kit نفسه، فما له قائمة مساهمة."}},JO={en:{head:"Tell the maintainers first",sub:"squad-kit fills in a new issue on the main repo with your idea. You read it there and send it yourself: squad-kit posts nothing.",title:"Your idea in a few words",text:"A few lines about it (optional)",fill:"Fill in the page",open:"Open the new issue page",filled:"The page is ready. Open it, read it, and press Submit there when you are happy with it."},ar:{head:"أخبر المشرفين أول",sub:"squad-kit يعبّي لك مهمة جديدة على المستودع الرئيسي بفكرتك. تقرأها هناك وترسلها بنفسك: squad-kit ما ينشر شيء.",title:"فكرتك بكلمات قليلة",text:"كم سطر عنها (اختياري)",fill:"عبّ الصفحة",open:"افتح صفحة المهمة الجديدة",filled:"الصفحة جاهزة. افتحها واقرأها، واضغط Submit هناك إذا عجبتك."}};function yk(e,n,s){const r=n.host??"",i=n.main??"",a=s==="ar",l=n.items.find(c=>c.id==="sign-in")?.state==="done";switch(e.id){case"sign-in":return e.state==="done"?{title:a?`مسجّل في ${r}`:`Signed in to ${r}`,line:e.account?a?`باسم ${e.account}.`:`As ${e.account}.`:e.line}:{title:a?`سجّل الدخول في ${r}`:`Sign in to ${r}`,line:a?`سجّل الدخول مرة وحدة بأداة ${r} الرسمية. squad-kit ما يحفظ أي كلمة سر.`:`Sign in once with ${r}'s own tool. squad-kit keeps no password.`,button:a?`سجّل الدخول بـ ${r}`:`Sign in with ${r}`};case"copy":{const c=a?`نسختك الخاصة على ${r}`:`Your own copy on ${r}`;return e.state==="todo"?{title:c,line:a?`هذا المجلد مربوط بـ ${i}، وبس مالكه يقدر يغيّره. squad-kit يسوي لك نسختك (fork) ويرسل شغلك لها.`:`This folder points at ${i}, which only its owner can change. squad-kit makes your own copy (a fork) and sends your work there.`,button:a?"سوّ نسختي":"Make my copy"}:e.state==="blocked"?{title:c,line:a?`سجّل الدخول في ${r} أول.`:`Sign in to ${r} first.`}:n.copy?{title:c,line:a?`${n.copy}، نسخة من ${i}. قصصك تروح لـ ${i} كطلبات دمج منها.`:`${n.copy}, a copy of ${i}. Your stories go to ${i} as pull requests from it.`}:{title:c,line:a?`تقدر ترسل تغييراتك لـ ${i} مباشرة.`:e.line}}case"up-to-date":{const c=a?`محدّث مع ${ia(i)}`:`Up to date with ${ia(i)}`,u=e.count??0;return e.state==="todo"?{title:c,line:a?`في ${u} تغيير جديد على ${ia(i)} من بعد نسختك. خذها قبل ما تبدأ.`:`${QO(u,"One new change","{n} new changes")} on ${ia(i)} since your copy. Bring ${u===1?"it":"them"} in before you start.`,button:a?"حدّثها":"Bring it up to date"}:e.state==="blocked"&&u?{title:c,line:a?`نسختك فيها ${u} تغيير مو موجود في ${i}. squad-kit يخليها زي ما هي، وتقدر تكتب فكرتك. عشان تطابق ${i}، أرسلها كطلب دمج أو اسأل مهندس.`:e.line}:e.state==="blocked"?{title:c,line:l?a?"سوّ نسختك أول.":"Make your own copy first.":a?`سجّل الدخول في ${r} أول.`:`Sign in to ${r} first.`}:e.state==="done"?{title:c,line:a?`نسختك فيها كل شيء من ${ia(i)}.`:`Your copy has everything in ${ia(i)}.`}:{title:c,line:e.line}}case"rules":return{title:a?"قواعد squad-kit":"squad-kit's rules",line:a?"ملفات صغيرة، طبقات واضحة، كل زر له أمر، وأقل من 6 ميجا. الفريق يلتزم بها والفحوص تحرسها.":"Small files, clear layers, every button with its command, under 6 MB. Your squad follows them and the checks hold them.",button:a?"اقرأ القواعد":"Read the rules"};case"idea":return{title:a?"فكرة كبيرة؟":"A big idea?",line:a?"أخبر المشرفين أول، عشان ما يبني اثنين نفس الشيء. squad-kit يكتب الملاحظة من فكرتك، وأنت ترسلها.":"Tell the maintainers first, so nobody builds the same thing twice. squad-kit writes the note from your idea; you send it.",button:a?"أخبر المشرفين":"Tell the maintainers"};default:return{title:e.title,line:e.line}}}const Ri={en:{head:"Pull request",open:e=>`Open on ${e}`,note:"squad-kit never merges into the main repo. Only its owner can.",step:{"looks-right":()=>({title:"Looks right",sub:"You checked the proof"}),pushed:(e,n)=>({title:"Pushed to your fork",sub:[e,n&&`branch ${n}`].filter(Boolean).join(", ")}),opened:e=>({title:`Pull request opened into ${e??"the main repo"}`,sub:"With the proof for each line and the review"}),review:"The owner reviews it",merged:"Merged by the owner"},reviewSub:{waiting:"Waiting for the owner. Nothing to do now.",notes:"The owner asked for changes.",fixing:"The Builder is fixing the owner's notes.",closed:"Closed by the owner without merging.",merged:""},closedTitle:"Closed by the owner",notesHead:"The owner asked for changes",notesTag:"Changes for you",line:e=>`line ${e}`,fix:"Fix these",reply:e=>`Reply on ${e}`,ask:"Ask the lead",askText:(e,n)=>`The owner left these notes on the pull request of ${e}. What do they ask for, and should the Builder fix them?
715
+
716
+ ${n}`,fixNote:"The Builder fixes them, squad-kit pushes again and answers each comment.",leave:e=>`I answered them on ${e}`,leaveNote:"squad-kit marks them answered and waits for the owner again.",fixedHead:"Fixed and sent",fixedTag:"Done",fixedIn:"Fixed in",pushed:"Pushed: the pull request is updated, and each comment has its answer.",pushedSome:"Pushed: the pull request is updated. squad-kit answers the rest of the comments at its next look.",mergedHead:"Merged by the owner",mergedSub:(e,n,s,r)=>`${e} #${n}, on ${s} at ${r}. You are now one of its contributors.`,syncLater:"Before your next story, squad-kit brings your fork up to date.",check:"Check again",looked:e=>`squad-kit looks by itself every 3 minutes. Last look at ${e}.`,notLooked:"squad-kit looks by itself every 3 minutes."},ar:{head:"طلب الدمج",open:e=>`افتح على ${e}`,note:"squad-kit ما يدمج أبداً في المستودع الرئيسي. بس مالكه يقدر.",step:{"looks-right":()=>({title:"تمام",sub:"راجعت الإثبات"}),pushed:(e,n)=>({title:"انرفع إلى نسختك",sub:[e,n&&`فرع ${n}`].filter(Boolean).join("، ")}),opened:e=>({title:`انفتح طلب دمج إلى ${e??"المستودع الرئيسي"}`,sub:"مع إثبات كل سطر والمراجعة"}),review:"المالك يراجعه",merged:"دمجه المالك"},reviewSub:{waiting:"بانتظار المالك. ما عليك شيء الآن.",notes:"المالك طلب تعديلات.",fixing:"المنفّذ يصلّح ملاحظات المالك.",closed:"سكّره المالك بدون دمج.",merged:""},closedTitle:"سكّره المالك",notesHead:"المالك طلب تعديلات",notesTag:"تعديلات لك",line:e=>`السطر ${e}`,fix:"صلّحها",reply:e=>`رد على ${e}`,ask:"اسأل القائد",askText:(e,n)=>`المالك ترك هذه الملاحظات على طلب دمج ${e}. وش يطلب، وهل يصلّحها المنفّذ؟
717
+
718
+ ${n}`,fixNote:"المنفّذ يصلّحها، وsquad-kit يرفع مرة ثانية ويرد على كل تعليق.",leave:e=>`رديت عليها على ${e}`,leaveNote:"squad-kit يعتبرها مردود عليها وينتظر المالك من جديد.",fixedHead:"اتصلحت وانرسلت",fixedTag:"تم",fixedIn:"اتصلحت في",pushed:"انرفع: طلب الدمج تحدّث، وكل تعليق عليه رد.",pushedSome:"انرفع: طلب الدمج تحدّث. squad-kit يرد على باقي التعليقات في نظرته الجاية.",mergedHead:"دمجه المالك",mergedSub:(e,n,s,r)=>`${e} #${n}، في ${s} الساعة ${r}. صرت من المساهمين فيه.`,syncLater:"قبل قصتك الجاية، squad-kit يحدّث نسختك.",check:"افحص مرة ثانية",looked:e=>`squad-kit يطالع لحاله كل 3 دقايق. آخر مرة الساعة ${e}.`,notLooked:"squad-kit يطالع لحاله كل 3 دقايق."}};function e_(e,n){return ve({queryKey:["journey",e??""],queryFn:()=>ye(`/api/v1/contribute/journey${e?`?ticket=${encodeURIComponent(e)}`:""}`),enabled:n,refetchInterval:5e3})}function t_({ticket:e}){const n=De(),s=n.data?.ready?!!n.data.self:!1,r=e_(e,s).data;if(!s||!r?.self)return null;const i=Br(),a=ZO[i];return t.jsxs("div",{className:"jr",dir:i==="ar"?"rtl":"ltr",lang:i,children:[t.jsxs(ge,{to:"/contribute",className:"jr-t",title:r.ticket?a.story(r.ticket):void 0,children:[t.jsx("img",{src:"/logo.svg",alt:"",width:30,height:30}),t.jsxs("span",{children:[t.jsx("b",{children:a.title}),t.jsx("small",{children:a.sub})]})]}),t.jsx("ol",{"aria-label":a.title,children:a.steps.map((l,c)=>{const u=r.closed&&c===r.at;return t.jsxs("li",{className:u?"x":c<r.at?"d":c===r.at?"n":"","aria-current":c===r.at?"step":void 0,children:[t.jsx("span",{"aria-hidden":"true",children:u?t.jsx(Ue,{size:10,strokeWidth:3}):c<r.at&&t.jsx(ce,{size:10,strokeWidth:3})}),u?a.closed:l]},l)})})]})}const n_=[{to:"/overview",label:"Overview",icon:a1,badge:"setup"},{to:"/contribute",label:"Contribute",icon:eS,badge:"self"},{to:"/requirements",label:"Requirements",icon:nb,badge:"reqs"},{to:"/board",label:"Board",icon:eb},{to:"/backlog",label:"Backlog",icon:oS},{to:"/inbox",label:"Waiting for you",icon:iS,badge:"you"},{to:"/lead",label:"Squad lead",icon:Ma,badge:"lead"},{to:"/conversations",label:"Conversations",icon:ya,badge:"chats"},{to:"/releases",label:"Releases",icon:Zn},{to:"/architecture",label:"Architecture",icon:hS},{to:"/bugs",label:"Bugs",icon:Js,badge:"bugs"},{to:"/harness",label:"Harness",icon:ja},{to:"/tools",label:"Tools",icon:sl,badge:"tools"},{to:"/settings",label:"Settings",icon:gS}];function s_(){const e=De(),{theme:n,toggleTheme:s,showCommands:r,toggleCommands:i}=Le(),a=zr({select:$=>$.location.pathname}),l=zr({select:$=>$.location.search.ticket??/\/tickets\/([^/]+)\/proof/.exec($.location.pathname)?.[1]}),c=e.data?.ready?e.data.meta:void 0,u=e.data?.ready?e.data.tickets:[],h=u.filter($=>!$.mergedAt&&$.stage!=="done"&&!$.archived).length,m=Ou(),p=u.filter($=>$.kind==="bug").length,x=(c?.user.name??"You").slice(0,2).toUpperCase(),g=Jd().data?.filter($=>$.open).length??0,j=RO(),b=i5(6e4).data?.lines.filter($=>$.priority==="required"&&$.state!=="ready"&&$.state!=="not-here").length??0,w=e4(5e3),S=n$(w.data?.breakdowns??[],c?.user.name),T=_u(5e3).data?.conversations.some($=>$.thinking)??!1,[E,z]=N.useState(!1);return N.useEffect(()=>z(!1),[a]),a.startsWith("/conversations")||a.startsWith("/setup")?t.jsxs("div",{className:"fullpage",children:[t.jsx(Ff,{}),t.jsx(If,{}),t.jsx(ok,{}),t.jsx("div",{className:"canvas-b",children:t.jsx(Km,{})}),!a.startsWith("/setup")&&t.jsx(dk,{})]}):t.jsxs("div",{className:"app",children:[t.jsxs("header",{className:"mtop",children:[t.jsx("button",{className:"iconbtn",onClick:()=>z(!0),"aria-label":"Open the menu","aria-expanded":E,children:t.jsx(cS,{size:17})}),t.jsx(R,{as:"b",text:c?.project??"Your project"}),m>0&&t.jsx(ge,{to:"/inbox",className:"badge you","aria-label":`${m} waiting for you`,children:m})]}),E&&t.jsx("div",{className:"side-veil",onClick:()=>z(!1)}),t.jsxs("aside",{className:`side ${E?"open":""}`,children:[t.jsxs("a",{className:"brand",href:"/",title:"All your projects",children:[t.jsx("img",{src:"/logo.svg",alt:""}),t.jsx("b",{children:"squad-kit"}),c?.engine==="demo"&&t.jsx("small",{title:"The squad plays back a recorded run",children:"Demo"})]}),t.jsxs("a",{className:"proj",href:"/",title:"All your projects",children:[t.jsx("span",{className:"pm",children:(c?.project??"P").charAt(0)}),t.jsxs("div",{children:[t.jsx(R,{as:"b",text:c?.project??"Your project"}),t.jsx("span",{children:h===1?"1 open ticket":`${h} open tickets`})]}),t.jsx(H9,{size:14,className:"sw"})]}),n_.map($=>{const P=$.badge==="you"?m:$.badge==="bugs"?p:$.badge==="chats"?g:$.badge==="tools"?b:0;if($.badge==="setup")return t.jsxs(ge,{to:$.to,className:`nav ${a.startsWith($.to)?"on":""}`,onClick:()=>z(!1),children:[t.jsx($.icon,{size:16}),$.label,j&&t.jsx("span",{className:"badge you","aria-label":"Waits for you",children:"1"})]},$.to);if($.badge==="self"&&!(e.data?.ready&&e.data.self))return null;if($.badge==="reqs")return t.jsxs(ge,{to:$.to,className:`nav ${a.startsWith($.to)?"on":""}`,onClick:()=>z(!1),children:[t.jsx($.icon,{size:16}),$.label,S>0?t.jsx("span",{className:"badge you","aria-label":`${S} ${S===1?"needs":"need"} you`,children:S}):t.jsx("span",{className:"badge new",children:"New"})]},$.to);const L=a.startsWith($.to)||$.to==="/inbox"&&a.endsWith("/proof")||$.to==="/tools"&&a.startsWith("/connections");return $.badge==="lead"?t.jsxs(ge,{to:$.to,className:`nav navlead ${L?"on":""}`,onClick:()=>z(!1),title:"Ask from any page with ⌘K or Ctrl+K",children:[t.jsx($.icon,{size:16}),$.label,T&&t.jsx("span",{className:"leaddot","aria-label":"The lead is answering"})]},$.to):t.jsxs(ge,{to:$.to,className:`nav ${L?"on":""}`,onClick:()=>z(!1),children:[t.jsx($.icon,{size:16}),$.label,P>0&&t.jsx("span",{className:`badge ${$.badge==="you"?"you":$.badge==="chats"?"talk":""}`,children:P})]},$.to)}),t.jsx("div",{className:"grow"}),t.jsx(hO,{}),t.jsx("div",{className:"engines",children:(c?.tools??[]).map($=>t.jsxs("div",{className:"row",children:[t.jsx("span",{children:$.name}),t.jsx("span",{className:`dot ${$.ready?"":"off"}`,children:$.ready?"Ready":"Not installed"})]},$.name))}),t.jsxs("button",{className:"switch",onClick:i,"aria-pressed":r,children:[t.jsxs("span",{children:[t.jsx(nl,{size:15}),"Show commands"]}),t.jsx("span",{className:`tog ${r?"on":""}`})]}),t.jsxs("div",{className:"me",children:[t.jsx("span",{className:"av",children:x}),t.jsxs("div",{children:[c?.user.name??"You",t.jsx("small",{children:c?.user.role??""})]}),t.jsx("button",{className:"theme",onClick:s,"aria-label":n==="light"?"Switch to dark":"Switch to light",children:n==="light"?t.jsx(wl,{size:15}):t.jsx(Sl,{size:15})})]})]}),t.jsxs("main",{className:"canvas",children:[t.jsx(t_,{...l?{ticket:decodeURIComponent(l)}:{}}),t.jsxs(vO,{children:[t.jsx(Ff,{}),t.jsx(wb,{}),t.jsx(If,{}),e.data?.ready&&t.jsx(lO,{}),e.data?.ready&&e.data.console?.outdated&&t.jsx(BS,{}),t.jsx(ok,{})]}),t.jsx("div",{className:"canvas-b",children:t.jsx(Km,{})})]}),t.jsx(dC,{}),t.jsx(dk,{})]})}function o5({error:e,reset:n}){const s=e instanceof Error?e.stack??e.message:String(e);return t.jsx("div",{className:"center",role:"alert",style:{padding:24},children:t.jsxs("div",{style:{maxWidth:520},children:[t.jsxs("h2",{children:[t.jsx(Is,{size:18,style:{verticalAlign:"-3px",marginRight:8}}),"This page ran into a problem"]}),t.jsx("p",{children:"Your work is safe, and so is what you typed. Try again, or go on from the board."}),t.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginTop:12},children:[t.jsx("button",{className:"btn pri",onClick:()=>n?n():window.location.reload(),children:"Try again"}),t.jsx("a",{className:"btn",href:`${ga}/board`,children:"Go to the board"}),t.jsx("button",{className:"btn",onClick:()=>Cl.open({}),children:"Report a problem"})]}),t.jsxs("details",{style:{marginTop:14},children:[t.jsx("summary",{className:"note",children:"For engineers"}),t.jsx("pre",{className:"mono",style:{fontSize:12,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:s})]})]})})}class jk extends N.Component{state={error:null};static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,s){console.error(n,s.componentStack)}render(){return this.state.error===null?this.props.children:this.props.fallback??t.jsx(o5,{error:this.state.error,reset:()=>this.setState({error:null})})}}function r_(e,n,s=3){const r=e?e.split(`
719
+ `):[],i=n.split(`
720
+ `);if(r.length*i.length>25e4)return[...r.map(g=>({kind:"del",text:g})),...i.map(g=>({kind:"add",text:g}))];const a=r.length,l=i.length,c=Array.from({length:a+1},()=>new Array(l+1).fill(0));for(let g=a-1;g>=0;g--)for(let j=l-1;j>=0;j--)c[g][j]=r[g]===i[j]?c[g+1][j+1]+1:Math.max(c[g+1][j],c[g][j+1]);const u=[];let h=0,m=0;for(;h<a&&m<l;)r[h]===i[m]?(u.push({kind:"same",text:r[h]}),h++,m++):c[h+1][m]>=c[h][m+1]?u.push({kind:"del",text:r[h++]}):u.push({kind:"add",text:i[m++]});for(;h<a;)u.push({kind:"del",text:r[h++]});for(;m<l;)u.push({kind:"add",text:i[m++]});const p=u.map((g,j)=>g.kind!=="same"||u.slice(Math.max(0,j-s),j+s+1).some(k=>k.kind!=="same")),x=[];return u.forEach((g,j)=>{p[j]?x.push(g):x.at(-1)?.kind!=="gap"&&x.push({kind:"gap",text:""})}),x}function i_({t:e}){const[n,s]=N.useState(null),r=N.useRef(null);return bg(e.id,()=>vg(r.current)),N.useLayoutEffect(()=>{const i=()=>{const a=r.current;a&&(a.style.height=`${Math.max(360,window.innerHeight-a.getBoundingClientRect().top-20)}px`)};return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),t.jsxs("div",{className:"talkhere",ref:r,children:[t.jsx(zu,{id:e.id,size:"pop",onOpenDoc:s}),n&&kl.createPortal(t.jsx("div",{className:"talkhere-doc",children:t.jsx(Iu,{doc:n,onClose:()=>s(null)})}),document.body)]})}function a_({t:e,onTab:n}){const[s,r]=N.useState(e.chat?.open?"talk":"happened"),[i,a]=N.useState(null),l=U4(e),c=l.data?.steps??[];return t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"convbar",children:[t.jsxs("div",{className:"seg",role:"group","aria-label":"View",children:[e.chat&&t.jsx("button",{className:s==="talk"?"on":"","aria-pressed":s==="talk",onClick:()=>r("talk"),children:"The talk"}),t.jsx("button",{className:s==="happened"?"on":"","aria-pressed":s==="happened",onClick:()=>r("happened"),children:"What happened"}),t.jsx("button",{className:s==="log"?"on":"","aria-pressed":s==="log",onClick:()=>r("log"),children:"Full log"})]}),t.jsx("span",{className:"grow"}),s==="happened"&&c.length>0&&t.jsxs("span",{className:"note convcount",children:[c.length," ",c.length===1?"step":"steps",l.data.seconds>=1?` · ${Du(l.data.seconds)} in all`:""]})]}),s==="talk"&&e.chat?t.jsx(i_,{t:e}):s==="happened"?t.jsx(HM,{t:e,onTab:n,onLog:u=>{a(u),r("log")}}):t.jsx(o_,{t:e,chosenKey:i,setKey:a})]})}function o_({t:e,chosenKey:n,setKey:s}){const i=ve({queryKey:["conversations",e.id],queryFn:()=>ye(`/api/v1/tickets/${e.id}/conversations`),refetchInterval:3e3}).data??[],a=n??i.filter(p=>p.started).at(-1)?.key??null,l=ve({queryKey:["conversation",e.id,a],queryFn:()=>ye(`/api/v1/tickets/${e.id}/conversations/${a}`),enabled:!!a,refetchInterval:e.live?2e3:1e4}),c=N.useMemo(()=>Cw(l.data?.updates??[]),[l.data]),[u,h]=N.useState(!0),m=N.useRef(null);return N.useEffect(()=>{u&&m.current?.scrollIntoView({block:"end"})},[c.length,u,a]),i.length?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"pills",style:{marginBottom:6},children:[i.map(p=>t.jsx("button",{className:`btn sm ${p.key===a?"pri":""}`,disabled:!p.started,onClick:()=>s(p.key),children:p.label},p.key)),t.jsx("span",{className:"grow"}),t.jsxs("label",{className:"note",style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:12.5},children:[t.jsx("input",{type:"checkbox",checked:u,onChange:p=>h(p.target.checked)})," Follow live"]})]}),t.jsxs("p",{className:"note",style:{fontSize:12.5,margin:"0 0 14px"},children:["Everything the ",i.find(p=>p.key===a)?.label??"agent"," did, step by step. Read only."," ",l.data&&l.data.total>(l.data.updates.length??0)?`Showing the latest ${l.data.updates.length} of ${l.data.total} entries.`:""]}),t.jsxs("div",{className:"conv",children:[c.map((p,x)=>t.jsx(c_,{it:p,ticket:e.id,cwd:l.data?.cwd},p.kind==="tool"?p.id:x)),t.jsx("div",{ref:m})]}),a&&t.jsxs("div",{className:"convactions",children:[t.jsx(l_,{t:e,to:kk[a]??"builder"}),!e.chat?.open&&!e.takenOver&&t.jsx(Ai,{t:e,agent:kk[a]??"builder"})]}),l.data?.command&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["Open it in ",l.data.tool??"a terminal"]}),t.jsx(X,{text:l.data.command}),t.jsx("p",{className:"note",style:{fontSize:12.5,marginTop:6},children:a==="build"&&z1(e)?t.jsxs(t.Fragment,{children:["To work in it yourself, press ",t.jsx("b",{children:"Take over"})," first, so you and the squad never edit at the same time."," ",t.jsx(M1,{t:e})]}):e.takenOver?.free?"It is in a conversation outside squad-kit. Bring it back on the Now tab.":e.takenOver?"The ticket is yours: type into it freely, then press Give back on the Now tab.":"Read it any time. To work in it, take the ticket over while it is being built."})]})]}):t.jsx("p",{className:"note",children:"No conversation yet. It starts when the Analyst reads the ticket."})}const kk={intake:"analyst",build:"builder",review:"reviewer",tester:"tester"},vk={analyst:"Analyst",architect:"Architect",builder:"Builder",reviewer:"Reviewer",tester:"Tester"};function l_({t:e,to:n}){const s=re(),[r,i]=$e(e.id,`message-${n}`,"");if(e.stage==="done")return null;const a=()=>s.mutate({path:`/api/v1/tickets/${e.id}/notes`,body:{text:r,to:n},done:`Sent. ${e.now?.noteWhen??`The ${vk[n]} reads it at its next step.`}`},{onSuccess:()=>i("")});return t.jsxs("div",{className:"msgagent",children:[t.jsx("input",{className:"input",dir:je(r),value:r,onChange:l=>i(l.target.value),placeholder:`Message the ${vk[n]}…`,onKeyDown:l=>l.key==="Enter"&&r.trim()&&!s.isPending&&a()}),t.jsxs("button",{className:"btn sm pri",disabled:!r.trim()||s.isPending,onClick:a,children:[t.jsx(qs,{size:13})," Send"]})]})}function c_({it:e,ticket:n,cwd:s}){if(e.kind==="plan")return t.jsx(x_,{entries:e.entries});if(e.kind==="tool")return t.jsx(h_,{it:e,ticket:n,cwd:s});const{from:r,content:i}=e;return r==="agent"?t.jsx("div",{className:"conv-text",children:t.jsx(qg,{content:i,ticket:n})}):t.jsx(d_,{from:r,content:i,ticket:n})}function d_({from:e,content:n,ticket:s}){const r=n.type==="text"?n.text:"",i=r.length>420||r.split(`
721
+ `).length>8,[a,l]=N.useState(!i&&e!=="thought"),c=e==="squad-kit"?"squad-kit asked":e==="claude-code"?"Note from Claude Code":"Thinking";return t.jsxs("div",{className:e==="thought"?"conv-thought":"conv-prompt",children:[t.jsxs("button",{className:"conv-who linkish",onClick:()=>l(!a),children:[e==="thought"&&t.jsx(Hv,{size:12})," ",c," ",!a&&t.jsx("span",{className:"note",children:"· show"})]}),a&&(e==="thought"?t.jsx(f1,{style:{whiteSpace:"pre-wrap"},text:r}):t.jsx(qg,{content:n,ticket:s}))]})}const u_={read:Dr,edit:Id,delete:Ue,move:Id,search:wi,execute:nl,think:Hv,fetch:tS,switch_mode:sl,other:sl};function h_({it:e,ticket:n,cwd:s}){const r=e.content.some(m=>m.type==="content"&&(m.content.type==="image"||m.content.type==="resource_link")),i=e.content.some(m=>m.type==="diff"),a=e.status==="failed"&&!e.skipped,[l,c]=N.useState(!e.skipped&&(i||r||a));N.useEffect(()=>{(a||r)&&c(!0)},[a,r]);const u=e.answer?qs:e.skipped?Ra:u_[e.toolKind]??sl,h=e.content.length>0||e.command||e.skipped;return t.jsxs("div",{className:`conv-tool ${e.skipped?"skipped":e.status}`,children:[t.jsxs("button",{className:"conv-tool-head",onClick:()=>h&&c(!l),"aria-expanded":l,children:[t.jsx(u,{size:14}),t.jsx("span",{className:"mono conv-tool-title",children:s?e.title.split(`${s}/`).join(""):e.title}),t.jsx("span",{className:"conv-at",children:e.at?tn(e.at):""}),t.jsx(m_,{status:e.status,skipped:e.skipped})]}),e.blocked?.map(m=>t.jsx(p_,{line:m},m)),l&&h&&t.jsxs("div",{className:"conv-tool-body",children:[e.skipped&&t.jsx("p",{className:"note",children:"By design, nothing went wrong: squad-kit lets each step do only what it needs, and this was not part of it."}),e.command&&e.toolKind==="execute"?t.jsxs("pre",{className:"conv-cmd",children:["$ ",e.command]}):e.skipped&&e.detail&&t.jsx("pre",{className:"conv-cmd",children:e.detail}),e.content.map((m,p)=>t.jsx(f_,{c:m,ticket:n,cwd:s},p))]})]})}function p_({line:e}){const n=e.endsWith("Allow it in Settings.");return t.jsxs("p",{className:"conv-blocked",children:[t.jsx(c1,{size:13,"aria-hidden":"true"}),t.jsxs("span",{children:[n?e.slice(0,-9):e,n&&t.jsxs(t.Fragment,{children:[t.jsx(ge,{to:"/settings",children:"Settings"}),"."]})]})]})}function m_({status:e,skipped:n}){return n?t.jsxs("span",{className:"conv-status skip",children:[t.jsx(Ra,{size:12})," Skipped"]}):e==="completed"?t.jsxs("span",{className:"conv-status ok",children:[t.jsx(ce,{size:12})," Done"]}):e==="failed"?t.jsxs("span",{className:"conv-status bad",children:[t.jsx(Ue,{size:12})," Failed"]}):t.jsxs("span",{className:"conv-status run",children:[t.jsx(Xe,{size:12,className:"spin"})," Running"]})}function f_({c:e,ticket:n,cwd:s}){if(e.type==="diff"){const r=s&&e.path.startsWith(`${s}/`)?e.path.slice(s.length+1):e.path;return t.jsx(g_,{path:r,oldText:e.oldText??"",newText:e.newText,isNew:e.oldText==null})}return e.type==="terminal"?t.jsxs("p",{className:"note",children:["Terminal ",e.terminalId]}):e.content.type==="text"?e.content.text.trimStart().startsWith("```")?t.jsx(c5,{text:e.content.text}):t.jsx(l5,{text:e.content.text}):t.jsx(qg,{content:e.content,ticket:n})}function l5({text:e}){const n=e.length>600||e.split(`
722
+ `).length>12,[s,r]=N.useState(!n);return t.jsxs("div",{className:"conv-out",children:[t.jsx("pre",{children:s?e:`${e.split(`
723
+ `).slice(0,10).join(`
724
+ `).slice(0,600)}…`}),n&&t.jsx("button",{className:"linkbtn",onClick:()=>r(!s),children:s?"Show less":"Show all output"})]})}function g_({path:e,oldText:n,newText:s,isNew:r}){const i=N.useMemo(()=>r_(n,s),[n,s]),a=i.filter(m=>m.kind==="add").length,l=i.filter(m=>m.kind==="del").length,[c,u]=N.useState(i.length<=40),h=c?i:i.slice(0,40);return t.jsxs("div",{className:"conv-diff",children:[t.jsxs("div",{className:"conv-diff-head mono",children:[t.jsx("span",{style:{overflowWrap:"anywhere"},children:e}),t.jsx("span",{className:"grow"}),r?t.jsxs("span",{className:"add",children:["new file · ",a," lines"]}):t.jsxs("span",{children:[t.jsxs("span",{className:"add",children:["+",a]})," ",t.jsxs("span",{className:"del",children:["−",l]})]})]}),t.jsx("pre",{children:h.map((m,p)=>m.kind==="gap"?t.jsx("div",{className:"gap",children:"⋯"},p):t.jsxs("div",{className:m.kind,children:[t.jsx("span",{className:"sign",children:m.kind==="add"?"+":m.kind==="del"?"−":" "}),m.text||" "]},p))}),i.length>40&&t.jsx("button",{className:"linkbtn",style:{margin:"0 10px 8px"},onClick:()=>u(!c),children:c?"Show less":`Show all ${i.length} lines`})]})}function x_({entries:e}){const n=e.filter(s=>s.status==="completed").length;return t.jsxs("div",{className:"conv-plan",children:[t.jsxs("div",{className:"conv-who",children:[t.jsx(tb,{size:13})," Plan · ",n," of ",e.length," done"]}),e.map((s,r)=>t.jsxs("div",{className:`conv-plan-row ${s.status}`,...ze(s.content),children:[t.jsx("span",{className:"box",children:s.status==="completed"?t.jsx(ce,{size:11}):s.status==="in_progress"?t.jsx(Xe,{size:11,className:"spin"}):null}),t.jsx(R,{text:s.content})]},r))]})}function qg({content:e,ticket:n}){switch(e.type){case"text":return t.jsx(c5,{text:e.text});case"image":return t.jsx(A1,{className:"conv-img",src:`data:${e.mimeType};base64,${e.data}`,alt:"Picture the agent looked at"});case"audio":return t.jsx("audio",{controls:!0,src:`data:${e.mimeType};base64,${e.data}`});case"resource_link":return t.jsx(bk,{uri:e.uri,name:e.name,mime:e.mimeType??"",size:e.size??void 0,ticket:n});case"resource":return e.resource.text?t.jsx(l5,{text:e.resource.text}):t.jsx(bk,{uri:e.resource.uri,name:e.resource.uri.split("/").pop()??"file",mime:e.resource.mimeType??"",ticket:n})}}function bk({uri:e,name:n,mime:s,size:r,ticket:i}){const a=In(i,e);return s.startsWith("image/")&&s!=="image/svg+xml"?t.jsxs("div",{className:"conv-media",children:[t.jsx(A1,{className:"conv-img",src:a,alt:n}),t.jsx("span",{className:"note mono",children:n})]}):s.startsWith("video/")?t.jsxs("div",{className:"conv-media",children:[t.jsx("video",{className:"conv-img",src:a,controls:!0,preload:"metadata"}),t.jsx("span",{className:"note mono",children:n})]}):s.startsWith("audio/")?t.jsx("audio",{controls:!0,src:a}):t.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",className:"conv-file",children:[t.jsx(gs,{size:15}),t.jsx("span",{className:"mono",children:n}),t.jsx("span",{className:"note",children:[s.split("/").pop(),r?`${Math.max(1,Math.round(r/1024))} KB`:""].filter(Boolean).join(" · ")})]})}const y_=[m1];function c5({text:e}){const{theme:n}=Le();return t.jsx("div",{className:"md",children:t.jsx(eg,{remarkPlugins:[ig],rehypePlugins:y_,components:{a:({href:s,children:r})=>t.jsx("a",{href:s,target:"_blank",rel:"noreferrer",children:r}),code:({className:s,children:r})=>{const i=/language-(\w+)/.exec(s??"")?.[1],a=String(r).replace(/\n$/,"");return!i&&!a.includes(`
725
+ `)?t.jsx("code",{className:"mono",dir:"ltr",children:r}):t.jsxs("div",{className:"md-code",dir:"ltr",children:[i&&t.jsx("span",{className:"md-lang",children:i==="mermaid"?"Diagram (Mermaid)":i}),t.jsx(_3,{code:a,language:i??"text",theme:n==="dark"?ul.vsDark:ul.github,children:({tokens:l,getLineProps:c,getTokenProps:u})=>t.jsx("pre",{children:l.map((h,m)=>t.jsx("div",{...c({line:h}),children:h.map((p,x)=>t.jsx("span",{...u({token:p})},x))},m))})})]})}},children:e})})}function d5({t:e,banner:n}){const s=re(),r=e.testChange;if(!r?.ask)return null;const i=l=>s.mutate({path:`/api/v1/tickets/${e.id}/test-command`,body:{use:l},done:l?"squad-kit tests this project the new way from now on.":"squad-kit keeps the current way of testing."}),a=t.jsxs("div",{className:"outdated-item testchange",children:[t.jsxs("div",{className:"outdated-head",children:[t.jsx("span",{className:"ic",children:t.jsx(Zv,{size:15})}),t.jsx("b",{children:"The way this project's tests run changed, and squad-kit cannot tell if the new way checks as much as the current one."})]}),t.jsxs("div",{className:"row",children:[t.jsx("button",{className:"btn sm pri",disabled:s.isPending,title:"The checks stay as they are, and the Builder fixes what they find.",onClick:()=>i(!1),children:"Keep the current way"}),t.jsx("button",{className:"btn sm",disabled:s.isPending,title:"The checks use the new way from now on.",onClick:()=>i(!0),children:"Use the new way"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad test-command ${e.id} --keep`})]}),t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"Details for engineers"}),t.jsxs("p",{className:"note",children:["Current: ",t.jsx("code",{children:r.from}),t.jsx("br",{}),"New: ",t.jsx("code",{children:r.to}),r.ran?t.jsxs(t.Fragment,{children:[t.jsx("br",{}),r.ran]}):null]})]})]});return n?t.jsx("div",{className:"outdated","aria-label":"A choice about the tests",children:a}):a}const Ig="No tests ran, so squad-kit could not check that the work does what it should. Check the proof with extra care. To turn tests on, have an engineer add tests to the project.";function u5(e){return e?.checks==="unchecked"?"Not checked: no tests ran":e?.checks==="skipped"?/weakened/i.test(e.checksText??"")?"Tests weakened, you continued":"Checks failed, you continued":e?.checksText??"All checks pass"}function j_(e){if(e?.checks!=="unchecked")return null;const n=e.checksText?.split(" · ").slice(1).join(" · ");return Ig.replace("Check the proof",`${n?`Passed: ${n}. `:""}Check the proof`)}function Wu(e){return e?.checks==="pending"&&e.review==="pending"&&e.proof==="pending"}function k_(e){if(Wu(e))return"Built outside squad-kit, so squad-kit has not checked it. Try it yourself, or press Check at the top.";const n='Compare the screens before and after each "done when".';return e?.checks==="unchecked"?`Not checked: no tests ran, so look closely. ${n}`:e&&[e.checks,e.review,e.proof].some(s=>s==="skipped")?`You went past a gate, so look closely. ${n}`:e?.oldFailures?.length?`Every gate is green for this story's change. ${Fg(e.oldFailures.length)}, without it. ${n}`:`Every gate is green. ${n}`}function Fg(e){return e===1?"1 old test also fails on main":`${e} old tests also fail on main`}function h5(e){const n=e?.oldFailures??[];if(!n.length)return null;const s=n.length===1,r=[...new Set(n.map(i=>i.story).filter(Boolean))];return`${s?"This test fails":"These tests fail"} on main too, without this story's change, so ${s?"it is":"they are"} not this story's: ${n.map(i=>i.title).join("; ")}.${r.length?` ${r.join(" and ")} ${r.length===1?"fixes":"fix"} ${s?"it":"them"}.`:""}`}function p5(e){const n=(e.proof??[]).some(i=>i.shows==="broken"),s=(e.proof??[]).some(i=>i.shows==="not-shown"),r=(e.proof??[]).some(i=>i.shows==="off-screen");return e.gates?.proof==="skipped"?n?'A "done when" not working, you continued':s?'A "done when" not shown, you continued':r?"Not on a screen, you continued":"No screenshots, you continued":e.gates?.proof==="fail"&&n?'A "done when" not working yet':e.gates?.proof==="fail"&&s?'A "done when" not shown yet':e.gates?.proof==="fail"&&r?"Nothing shows on a screen yet":"Proof made"}function m5(e){return Wu(e.gates)?"None yet. squad-kit makes them when you press Check.":e.gates?.proof==="skipped"||(e.work?.screens??0)>0?"No screenshots were taken for this ticket. See the activity for why.":e.gates?.checks==="unchecked"?"No screens change in this ticket and no tests ran, so read the changes in the Changes tab.":"No screens change in this ticket, so the passing checks are the proof."}function v_(e){return e.added?`team's check "${e.added}"`:e.weakened?.length?"weakened tests":e.gate==="hooks"?"project's own check":e.gate==="checks"?"failed checks":e.gate==="proof"?"unfinished proof":"open review"}function us({state:e,text:n}){const s=e==="pass"?"ok":e==="skipped"?"skip":e==="unchecked"?"unchecked":"wait";return t.jsxs("span",{className:`pill ${s}`,title:e==="unchecked"?Ig:void 0,children:[e==="pass"&&t.jsx(ce,{size:13,strokeWidth:2.5}),e==="unchecked"&&t.jsx(Fn,{size:13,strokeWidth:2.5}),n]})}function f5({g:e,className:n=""}){const s=h5(e);return s?t.jsxs("p",{className:`note unchecked-why old-fails ${n}`,children:[t.jsx(Fn,{size:14,strokeWidth:2.4,"aria-hidden":"true"}),t.jsxs("span",{children:[t.jsxs("b",{children:[Fg(e.oldFailures.length),"."]})," ",t.jsx(R,{text:s})]})]}):null}function g5({g:e,className:n=""}){const s=j_(e);return s?t.jsxs("p",{className:`note unchecked-why ${n}`,children:[t.jsx(Fn,{size:14,strokeWidth:2.4,"aria-hidden":"true"}),t.jsxs("span",{children:[t.jsx("b",{children:"Not checked."})," ",s]})]}):null}const x5="Built without new tests",y5="Write new tests was off when this story was made, so the Builder wrote no new tests. squad-kit still ran your project's own checks, the review and the proof.";function Lg({t:e}){return e.noNewTests?t.jsx("span",{className:"prio notests",title:y5,children:x5}):null}function b_({t:e}){return e.noNewTests?t.jsx("span",{className:"prio notests",title:`${x5}. ${y5}`,children:"No new tests"}):null}function w_(e,n){return!!e.mergedAt||e.stage==="done"||n&&e.stage==="release"}function N_(){const e=De();return e.data?.ready?e.data.meta.engine==="demo":!1}function S_({t:e,onDeleted:n,items:s=[]}){const[r,i]=N.useState(!1),[a,l]=N.useState(null),c=w_(e,N_()),u=j5(e),h=N.useRef(null);N.useEffect(()=>{if(!r)return;const p=g=>h.current&&!h.current.contains(g.target)&&i(!1),x=g=>g.key==="Escape"&&i(!1);return document.addEventListener("mousedown",p),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",x)}},[r]);const m=p=>()=>{i(!1),p()};return t.jsxs("span",{className:"more",ref:h,children:[t.jsx("button",{className:"iconbtn","aria-label":"More actions","aria-haspopup":"menu","aria-expanded":r,title:"More actions",onClick:()=>i(!r),children:t.jsx(Gv,{size:16})}),r&&t.jsxs("div",{className:"more-menu",role:"menu",children:[s.map(p=>t.jsx("button",{role:"menuitem",onClick:m(p.onPick),children:p.label},p.key)),e.archived?t.jsxs("button",{role:"menuitem",onClick:m(u),children:[t.jsx(Bv,{size:15})," Unarchive"]}):c?t.jsxs("button",{role:"menuitem",onClick:m(()=>l("archive")),children:[t.jsx(Pd,{size:15})," Archive…"]}):e.ownerDeleted?t.jsxs("button",{role:"menuitem",className:"danger",onClick:m(()=>l("delete")),children:[t.jsx(zn,{size:15})," Remove from my board…"]}):t.jsxs("button",{role:"menuitem",className:"danger",onClick:m(()=>l("delete")),children:[t.jsx(zn,{size:15})," Delete ticket…"]})]}),a==="delete"&&t.jsx(Of,{t:e,onClose:()=>l(null),onDeleted:n}),a==="archive"&&t.jsx(C_,{t:e,onClose:()=>l(null)})]})}function j5(e){const n=re();return()=>n.mutate({path:`/api/v1/tickets/${e.id}/archive`,body:{undo:!0},done:`${e.id} is back on the board.`})}function eu({items:e,mark:n}){return t.jsx("ul",{className:"rmlist",children:e.map(s=>t.jsxs("li",{children:[n==="x"?t.jsx(Ue,{size:16,className:"x","aria-hidden":!0}):n==="hide"?t.jsx(Qv,{size:16,className:"hide","aria-hidden":!0}):t.jsx(ce,{size:16,className:"ok","aria-hidden":!0}),t.jsx(R,{text:s})]},s))})}function Of({t:e,onClose:n,onDeleted:s}){const r=re(),{toast:i}=Le(),[a,l]=N.useState(!!e.deleting?.remote),c=ve({queryKey:["delete-plan",e.id,a],queryFn:()=>ye(`/api/v1/tickets/${e.id}/delete?remote=${a?1:0}`),placeholderData:j8}),u=c.data,h=!!(u?.local??e.ownerDeleted),m=()=>r.mutate({path:`/api/v1/tickets/${e.id}/delete`,body:{remote:a},done:h?`Removed ${e.id} from your board.`:`Deleted ${e.id}. Its cost stays in Usage.`},{onSuccess:p=>{p.notes.length&&i(`${p.notes.join(". ")}.`),n(),s()},onError:()=>void c.refetch()});return t.jsxs(Ye,{title:h?`Remove ${e.id} from your board?`:`Delete ${e.id}?`,onClose:n,icon:t.jsx("span",{className:"glyph",children:t.jsx(zn,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn danger",disabled:!u||!!u.refused||r.isPending,onClick:m,children:[t.jsx(zn,{size:15})," ",h?r.isPending?"Removing…":"Remove from my board":r.isPending?"Stopping the squad and deleting…":u?.unfinished?"Delete again":`Delete ${e.id}`]}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:u?.command??`squad delete ${e.id}`})]}),children:[t.jsx(R,{as:"p",text:u?.summary??e.title}),c.isError&&t.jsx("div",{className:"stuckbox",children:c.error.message}),u?.refused&&t.jsx("div",{className:"stuckbox",children:u.refused}),u&&!u.refused&&t.jsxs(t.Fragment,{children:[u.unfinished&&t.jsxs("div",{className:"stuckbox rm-gap",children:["The last delete did not finish: ",u.unfinished,". Delete again to finish it. It goes on where it stopped."]}),u.warnings.length>0&&t.jsx("div",{className:"stuckbox rm-gap",children:u.warnings.map(p=>t.jsx(R,{as:"div",text:p},p))}),t.jsx("div",{className:"lbl",children:"This removes"}),t.jsx(eu,{items:u.removes,mark:"x"}),t.jsx("div",{className:"lbl",children:"This stays"}),t.jsx(eu,{items:u.stays,mark:"ok"}),u.pushed&&t.jsxs("label",{className:"talkfirst",children:[t.jsx("input",{type:"checkbox",checked:a,onChange:p=>l(p.target.checked)}),t.jsxs("span",{children:[t.jsx("b",{children:"Also delete its work in your team's shared copy of the code."})," ",u.pushed.why]})]}),h?t.jsxs("p",{className:"rm-note",children:["Only ",u.local?.by??"its owner"," could delete ",e.id,". This cleans your computer only."]}):t.jsxs("p",{className:"rm-note",children:["A ticket that is already merged cannot be deleted, because its work is in the code already. Use ",t.jsx("b",{children:"Archive"})," to hide it from the board. Its history stays."]})]})]})}function C_({t:e,onClose:n}){const s=re(),r=()=>s.mutate({path:`/api/v1/tickets/${e.id}/archive`,done:`Archived ${e.id}. Show archived, at the bottom of the board, shows it again.`},{onSuccess:n});return t.jsxs(Ye,{title:`Archive ${e.id}?`,onClose:n,icon:t.jsx("span",{className:"glyph",children:t.jsx(Pd,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:s.isPending,onClick:r,children:[t.jsx(Pd,{size:15})," Archive ",e.id]}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad archive ${e.id}`})]}),children:[t.jsx(R,{as:"p",text:`${e.title} · ${e.status}`}),t.jsx("div",{className:"lbl",children:"This hides"}),t.jsx(eu,{items:["The ticket from the board. Show archived, at the bottom of the board, shows it again."],mark:"hide"}),t.jsx("div",{className:"lbl",children:"This stays"}),t.jsx(eu,{items:["Its code, and its history in git and in .squad/",...e.release&&e.stage!=="done"?[`Its place in release ${e.release}`]:[],"The cost it used, still counted in Usage"],mark:"ok"}),t.jsx("p",{className:"rm-note",children:"Unarchive brings it back to the board, as it was."})]})}function $_({t:e,onDeleted:n}){const[s,r]=N.useState(!1),i=j5(e);if(e.ownerDeleted&&!e.deleting){const a=e.ownerDeleted;return t.jsxs("div",{className:"stuckbox rm-banner",children:[t.jsxs("span",{className:"grow",children:[t.jsxs("b",{children:["Deleted by ",a.by,"."]})," ",a.how==="note"?`${a.by} deleted ${e.id} on their computer ${st(a.at)}.`:`Its work is gone from your team's shared copy of the code, and it never reached the code itself, so ${a.by} deleted it.`," ","Only ",a.by," could delete it. Removing it here cleans your computer only."]}),t.jsxs("button",{className:"btn sm",onClick:()=>r(!0),children:[t.jsx(zn,{size:13})," Remove from my board"]}),t.jsx(X,{text:`squad delete ${e.id}`}),s&&t.jsx(Of,{t:e,onClose:()=>r(!1),onDeleted:n})]})}if(e.deleting){const a=!!e.deleting.error||Date.now()-Date.parse(e.deleting.at)>9e4;return t.jsxs("div",{className:"stuckbox rm-banner",children:[t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:e.deleting.error?"Delete did not finish.":"Deleting…"})," ",e.deleting.error?`${e.deleting.error}. Delete again to finish it; it goes on where it stopped.`:"The squad stops first, then each part of the ticket goes."]}),a&&t.jsxs("button",{className:"btn sm",onClick:()=>r(!0),children:[t.jsx(zn,{size:13})," Delete again"]}),t.jsx(X,{text:`squad delete ${e.id}`}),s&&t.jsx(Of,{t:e,onClose:()=>r(!1),onDeleted:n})]})}return e.archived?t.jsxs("div",{className:"calm rm-banner",children:[t.jsx("span",{className:"ring",children:t.jsx(Pd,{size:16})}),t.jsxs("div",{className:"grow",children:[t.jsxs("b",{children:["Archived ",st(e.archived.at)," by ",e.archived.by]}),t.jsx("span",{children:"It is off the board. Its history stays in git and in .squad/."}),t.jsx("div",{className:"rm-cmd",children:t.jsx(X,{text:`squad archive ${e.id} --undo`})})]}),t.jsxs("button",{className:"btn sm",onClick:i,children:[t.jsx(Bv,{size:13})," Unarchive"]})]}):null}function zg(e){const n=De(),s=n.data?.ready?n.data.meta.engine==="live":!0;return OT(e,s)}function k5({t:e}){const n=re(),s=ct[zg(e)],r=()=>Nt.open(e.id);return e.chat?.open?t.jsxs("button",{className:"btn sm askbtn",onClick:r,title:`The chat with the ${ct[e.chat.with]} is open`,children:[t.jsx(Xn,{size:14})," Open the chat"]}):t.jsxs("button",{className:"btn sm askbtn",disabled:n.isPending,title:`The ${s} answers. ${e.id} stays where it is.`,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/chat/start`,body:{ask:!0}},{onSuccess:r}),children:[t.jsx(Xn,{size:14})," Ask a question"]})}const Nm=12;function Uu({file:e,note:n}){const r=ve({queryKey:["api-proof",e],queryFn:async()=>(await fetch(Mt(`/api/v1/proof/${e}`))).json()}).data;return r?t.jsxs("div",{className:"apiproof",children:[n&&t.jsx(R,{as:"p",text:n}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Asked"}),t.jsxs("span",{className:"mono",children:[r.part,": ",r.method," ",r.path]})]}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"It answered"}),t.jsxs("span",{className:"mono",children:[r.status,r.file?" with a file":""]})]}),r.sheets?.map((i,a)=>t.jsxs("div",{className:"apiproof-sheet",children:[t.jsx(R,{as:"b",text:i.name}),t.jsx("div",{className:"apiproof-table",children:t.jsx("table",{dir:qS(i.rows),children:t.jsx("tbody",{children:i.rows.slice(0,Nm).map((l,c)=>t.jsx("tr",{children:l.map((u,h)=>c===0?t.jsx("th",{...ze(u),children:u},h):t.jsx("td",{...ze(u),children:u},h))},c))})})}),i.total>Nm&&t.jsxs("p",{className:"note",children:["The first ",Nm," of ",i.total," rows. The file has them all."]})]},a)),r.file&&t.jsx("p",{children:t.jsx("a",{className:"btn sm",href:Mt(`/api/v1/proof/${r.file}`),download:r.file,children:"Open the file it answered with"})}),t.jsxs("details",{children:[t.jsx("summary",{className:"note",children:"For engineers"}),t.jsxs("pre",{className:"mono apiproof-raw",children:[r.body?`Sent: ${r.body}
726
+
727
+ `:"",r.contentType?`Type: ${r.contentType}
728
+
729
+ `:"",r.answer??(r.file?`A file of ${r.bytes??0} bytes`:"No answer"),r.cut?`
730
+
731
+ (cut here: the rest is not kept)`:""]})]})]}):n?t.jsx("p",{className:"note",children:n}):null}function Mg({shows:e,size:n=15}){return e==="broken"?t.jsx(Ue,{size:n,strokeWidth:2.5,className:"vx","aria-hidden":"true"}):e==="not-shown"?t.jsx(Qv,{size:n,strokeWidth:2.25,className:"vq","aria-hidden":"true"}):e==="off-screen"?t.jsx(dS,{size:n,strokeWidth:2.25,className:"vo","aria-hidden":"true"}):t.jsx(ce,{size:n,strokeWidth:2.5,"aria-hidden":"true"})}function tu({shows:e}){const n=y$(e);return n?t.jsx("span",{className:`verdict ${Nu(e)}`,children:n}):null}function Og({shot:e,first:n,onOpen:s}){return e.more?.length?t.jsxs("div",{className:"proofmore",children:[t.jsx("small",{children:'More pictures of this "done when"'}),t.jsx("div",{className:"proofmore-row",children:e.more.map((r,i)=>t.jsxs("figure",{children:[_d(r.after)?t.jsx(Uu,{file:r.after}):t.jsx("button",{className:"zoom",onClick:()=>s(n+i),"aria-label":`Open picture ${i+2} of this "done when" full size`,children:t.jsx("img",{src:Mt(`/api/v1/proof/${r.after}`),alt:`${e.criterion}, ${r.note||`picture ${i+2}`}`,loading:"lazy"})}),t.jsxs("figcaption",{children:[r.note&&t.jsx(R,{text:r.note}),nr(r)&&t.jsx("code",{children:nr(r)}),r.device&&t.jsx("small",{className:"shotdevice",children:r.device})]})]},r.after))})]}):null}function T_({t:e}){return e.picturesNote?t.jsxs("p",{className:"critpage picturesnote",children:[e.picturesNote.text," ",t.jsx(ge,{to:"/tools",hash:e.picturesNote.link.split("#")[1],children:"See what's needed"})]}):null}function _a({t:e,className:n}){return t.jsxs(t.Fragment,{children:[!!e.alsoChanged?.length&&t.jsx(R,{as:"p",className:`note alsochanged${n?` ${n}`:""}`,lead:t.jsx("b",{children:"Also changed, not in the plan:"}),text:`${e.alsoChanged.join("; ")}.`}),t.jsx(E_,{t:e})]})}const wk={passed:["Passed","ok"],failed:["Did not pass","bug"],warned:["Did not pass, warn only","you"],"would-stop":["Would have stopped","you"],"cant-run":["Could not run","you"]};function E_({t:e}){return e.added?.length?t.jsxs("div",{className:"teamres",children:[t.jsx("div",{className:"lbl",children:"Added by your team"}),e.added.map(n=>t.jsxs("div",{children:[t.jsxs("div",{className:"teamtop",children:[t.jsx(R,{as:"b",text:n.name}),n.result&&t.jsx("span",{className:`pill ${wk[n.result][1]}`,children:wk[n.result][0]}),n.state==="try"&&t.jsx("small",{children:"On Try first, it stops nothing"})]}),n.why&&t.jsx(R,{as:"p",className:"note",text:n.why}),n.answers&&t.jsx("ol",{dir:tt(n.answers.map(s=>s.question).join(" ")).dir,children:n.answers.map(s=>t.jsxs("li",{...ze(s.question),children:[t.jsx(R,{text:s.question})," ",t.jsx("b",{className:s.answer==="no"?"no":"",children:s.answer==="yes"?"Yes":s.answer==="no"?"No":"Not answered"}),s.why&&t.jsx(R,{as:"small",text:` ${s.why}`})]},s.question))})]},n.id))]}):null}function nu({t:e}){return!e.offScreen?.length||xi(e)?null:t.jsxs("div",{className:"offscreen",children:[t.jsx("div",{className:"lbl",children:"Not on a screen"}),t.jsx("ul",{children:e.offScreen.map(n=>t.jsxs("li",{children:[t.jsx(R,{as:"b",text:n.criterion}),t.jsx(R,{text:n.why})]},n.criterion))})]})}function A_({t:e}){const n=j$(e);return n.length?t.jsxs("div",{className:"offscreen",children:[t.jsx("div",{className:"lbl",children:"Not on a screen, so look at these yourself"}),t.jsx("ul",{children:n.map(s=>t.jsxs("li",{children:[t.jsx(R,{as:"b",text:s.criterion}),t.jsx(R,{text:s.why})]},s.criterion))})]}):null}function Ca(e){return!!e.mergedAt||e.stage==="done"}function _g(e){const n=De(),s=n.data?.ready?[...n.data.tickets,...n.data.archived??[]]:[];return(e.dependsOn??[]).map(r=>s.find(i=>i.id===r)).filter(r=>!!r)}function P_(e){return e.waiting?.kind==="depends"||e.dependency?.way==="wait"&&!e.dependency.started&&!e.squad&&!e.waiting}const R_={branch:"--on-branch",anyway:"--anyway",wait:"--wait"};function q_({t:e}){const n=re(),s=De(),r=s.data?.ready?s.data.meta.engine==="live":!0,i=_g(e).filter(j=>!Ca(j)),a=e.dependency?.way==="wait"&&!e.waiting,[l,c]=N.useState(a?null:"branch"),u=i.map(j=>j.id).join(" and ")||"it",h=i.length===1?i[0]:void 0,m=!!(r&&h&&!h.worktree&&!h.branch),p=[{way:"branch",label:h?`Build on ${h.id}'s work`:"Build on its work",note:`The copy starts from ${u}'s work so far. Once ${u} is merged, the newest work comes in and any clash is settled.`,off:h?m?`${h.id} has no code yet.`:void 0:"A copy can start from one ticket only."},{way:"anyway",label:"Build anyway",note:`From your team's code, without ${u}. This stays on the ticket's record.`},{way:"wait",label:"Wait",note:`Starts by itself when ${u} ${i.length>1?"are":"is"} merged.`,off:a?"This is what it does now.":void 0}],x=p.find(j=>j.way===l&&!j.off),g={branch:`Building on ${u}'s work`,anyway:`Building without ${u}`,wait:`It starts by itself once ${u} is merged`};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:a?t.jsx(Zm,{size:15}):t.jsx(Qm,{size:15})}),t.jsxs("div",{children:[t.jsx(R,{as:"b",text:a?`Waits for ${u} to merge`:e.waiting?.summary??`${e.id} needs ${u}, which is not merged yet`}),t.jsx("span",{children:a?`It starts by itself once ${u} ${i.length>1?"are":"is"} merged. You can still build it another way.`:`Its design uses work from ${u}, which is not in the code yet. Choose how to build.`})]})]}),t.jsx("div",{className:"lbl",children:"What it needs"}),i.map(j=>t.jsxs("div",{className:"trow",children:[t.jsx("span",{className:"mono",children:j.id}),t.jsx(R,{as:"b",text:j.title}),t.jsxs("span",{className:"pill wait",children:[er[j.stage]," · not merged yet"]})]},j.id)),r&&i.some(I_)&&t.jsx(Dg,{t:e,text:`Merged ${u} on the code host already? squad-kit looks by itself every few minutes, or now:`}),t.jsxs("div",{className:"lbl",children:["How to build ",e.id]}),t.jsx("div",{className:"opts2",style:{gridTemplateColumns:"1fr"},children:p.map(j=>t.jsxs("button",{className:`opt2 ${l===j.way&&!j.off?"pick":""}`,disabled:!!j.off,onClick:()=>c(j.way),children:[t.jsxs("b",{children:[j.label,l===j.way&&!j.off&&t.jsxs("span",{children:[t.jsx(ce,{size:13,strokeWidth:2.5})," Your pick"]})]}),j.off?`${j.note} ${j.off}`:j.note]},j.way))})]}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn pri",disabled:!x||n.isPending,onClick:()=>x&&n.mutate({path:`/api/v1/tickets/${e.id}/build`,body:{way:x.way},done:g[x.way]}),children:[x?.way==="wait"?t.jsx(Zm,{size:15}):t.jsx(Qm,{size:15})," ",x?x.label:"Pick a way"]}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad build ${e.id} ${R_[x?.way??"branch"]}`})]})]})}function I_(e){return!Ca(e)&&(e.stage==="release"||!!e.clashedPr||e.waiting?.kind==="stuck"&&e.stuck?.gate==="merge")}function Dg({t:e,text:n}){const s=re();return t.jsxs("div",{className:"pills",style:{alignItems:"center",marginTop:10},children:[t.jsx("span",{className:"note",style:{fontSize:13},children:n}),t.jsxs("button",{className:"btn sm",disabled:s.isPending,title:`squad check-merge ${e.id}`,onClick:()=>s.mutate({path:`/api/v1/tickets/${e.id}/check-merge`,done:r=>r.line}),children:[t.jsx(xs,{size:13,className:s.isPending?"spin":void 0})," ",s.isPending?"Asking the code host…":"Check again"]}),t.jsx(X,{text:`squad check-merge ${e.id}`})]})}const F_={branch:e=>`Built on ${e}'s work. The newest work comes in once ${e} is merged.`,anyway:e=>`Built from your team's code without ${e}, as you chose.`,wait:e=>`Waits for ${e} to merge, then starts by itself.`};function L_({t:e}){const n=_g(e);if(!e.dependsOn?.length)return null;const s=e.dependency;return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Depends on"}),t.jsx("div",{className:"pills",children:e.dependsOn.map(r=>{const i=n.find(l=>l.id===r),a=!i||Ca(i);return t.jsxs("span",{className:`pill ${a?"ok":"wait"}`,title:i?.title,children:[a&&t.jsx(pu,{size:13}),t.jsxs("span",{children:[r,i&&t.jsxs(t.Fragment,{children:[" ",t.jsx(R,{text:i.title})]})," · ",i?a?"merged":"not merged yet":"left the board"]})]},r)})}),s&&(s.way!=="wait"||!s.started)&&t.jsxs("p",{className:"note",style:{marginTop:6},children:[F_[s.way](s.on.join(" and "))," ",s.by," chose this."]})]})}function z_({t:e}){const n=_g(e).filter(a=>!Ca(a));if(!n.length||e.waiting?.kind==="depends"||Ca(e))return null;const s=n.map(a=>a.id).join(", "),r=e.dependency,i=r?.way==="branch"?`On ${s}'s work`:r?.way==="wait"&&!r.started?`Waits for ${s}`:r?.way==="anyway"?`Without ${s}`:`Needs ${s}`;return t.jsx("span",{className:"prio owner",title:`Depends on ${s}, which is not merged yet`,children:i})}function M_({t:e}){const n=re(),s=De(),r=s.data?.ready?s.data.meta.engine!=="live":!1;if(!["implement","test","review"].includes(e.stage)||Ca(e)||e.takenOver||e.waiting&&!["proof","stuck"].includes(e.waiting.kind))return null;const i=!e.waiting&&(e.live||!!e.squad);return t.jsxs("button",{className:"btn sm",disabled:!!e.baseWanted||n.isPending,title:`squad bring-in ${e.id}`,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/bring-in`,done:r?"The sample board has no code, so nothing changed":i?"The newest work comes in when this step ends, before the checks":"Bringing in the newest work"}),children:[t.jsx(pu,{size:13})," ",e.baseWanted?"The newest work comes in after this step":"Bring in the newest work"]})}const O_=e=>(e??"").replace(/^https?:\/\//,"").replace(/\/$/,"");function __(e){return ve({queryKey:["try",e],queryFn:()=>ye(`/api/v1/tickets/${encodeURIComponent(e)}/try`),refetchInterval:n=>n.state.data?.state==="starting"?1e3:4e3})}function su({t:e}){const n=__(e.id).data;return t.jsxs("div",{className:"yourcheck",children:[t.jsx(D_,{t:e,s:n}),t.jsx(A_,{t:e}),t.jsx(B_,{t:e,s:n})]})}function D_({t:e,s:n}){const s=FT(e),r=ct[zg(e)];return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Where to look"}),s.length?t.jsx("ul",{className:"lookpages",children:s.map(i=>{const a=n?.state==="running"?n.pages?.find(c=>c.page===i)?.url:void 0,l=(e.proof??[]).filter(c=>Ud(c).includes(i)).map(c=>c.criterion);return t.jsxs("li",{children:[t.jsx("code",{children:i}),t.jsx(R,{className:"what",text:l.join(" · ")}),a&&t.jsxs("a",{className:"btn sm",href:a,target:"_blank",rel:"noreferrer",title:`Open ${a}`,children:[t.jsx(Xt,{size:13})," Open"]})]},i)})}):t.jsxs("p",{className:"note lookpages-none",children:["No page is saved for this story. Ask a question and the ",r," tells you where to look, or try it yourself."]})]})}function B_({t:e,s:n}){const s=re(),r=n?.state??"off",i=n?.phone,[a,l]=N.useState(i?.languages[0]??"en"),c=i?.ready&&i.languages.length>1&&a!=="en"?` --lang ${a}`:"",u=i?.ready?{phone:!0,...i.languages.length>1?{language:a}:{}}:void 0,h=()=>s.mutate({path:`/api/v1/tickets/${e.id}/try`,body:u,done:"Starting this story's own copy of the app"}),m=()=>s.mutate({path:`/api/v1/tickets/${e.id}/try`,body:{web:!0},done:"Starting the web version of this story"}),p=()=>s.mutate({path:`/api/v1/tickets/${e.id}/try/stop`,done:"Stopped it."}),x=r==="running"||r==="starting",g=!!(i?.on&&x);return t.jsxs("div",{className:`trybox ${r}`,children:[t.jsxs("div",{className:"trybox-row",children:[t.jsx("span",{className:"ring","aria-hidden":"true",children:r==="starting"?t.jsx(Xe,{size:15,className:"spin"}):t.jsx(kn,{size:14})}),t.jsxs("div",{className:"trybox-t",children:[t.jsx("b",{children:r==="running"?g?`Open on ${i?.run?.device??`the ${i?.word??"phone"}`}`:"Running":r==="starting"?"Starting…":"Try it yourself"}),t.jsxs("span",{children:[i?.ready?`Opens this story's own copy of the app on squad-kit's ${i.word}, with the change in it. Nothing is merged.`:"Runs this story's own copy of the app, with the change in it. Nothing is merged.",r==="running"&&n?.url?t.jsxs(t.Fragment,{children:[" ","At ",t.jsx("span",{className:"mono",children:O_(n.url)}),"."]}):null]})]}),t.jsx("span",{className:"grow"}),t.jsxs("div",{className:"trybox-acts",children:[r==="running"&&n?.url&&t.jsxs("a",{className:"btn sm pri",href:n.url,target:"_blank",rel:"noreferrer",title:`Open ${n.url}`,children:[t.jsx(Xt,{size:13})," Open"]}),x&&t.jsxs("button",{className:"btn sm",disabled:s.isPending,onClick:p,children:[t.jsx(Jn,{size:11})," Stop"]}),!x&&n?.can&&i?.ready&&t.jsx(G4,{languages:i.languages,value:a,onChange:l}),!x&&n?.can&&t.jsx("button",{className:"btn sm",disabled:s.isPending,onClick:h,children:r==="failed"?"Try again":"Try it yourself"})]})]}),i&&g&&t.jsx(zf,{phone:i,starting:r==="starting"}),i?.web&&g&&t.jsxs("div",{className:"trybox-acts",children:[t.jsx("button",{className:"btn sm",disabled:s.isPending,onClick:m,children:"Use the web version now"}),t.jsx(X,{text:`squad try ${e.id} --web`})]}),!x&&n?.ended&&t.jsx("p",{className:"trybox-why quiet",children:n.ended}),!x&&i&&!i.ready&&t.jsx(Q4,{phone:i}),r==="failed"&&t.jsx("p",{className:"trybox-why",children:n?.error??"The app did not start."}),r==="failed"&&n?.detail&&t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"See what failed"}),t.jsx("pre",{className:"app-out",children:n.detail})]}),!x&&n&&!n.can&&n.why&&t.jsx("p",{className:"trybox-why quiet",children:n.why}),!x&&n?.other&&n.can&&t.jsxs("p",{className:"trybox-why quiet",children:[n.other,"'s copy runs now. Trying this one stops it."]}),(x||n?.can)&&t.jsx(X,{text:x?`squad try ${e.id} --stop`:`squad try ${e.id}${c}`})]})}function W_({t:e}){const n=re(),s=Object.fromEntries((e.questions??[]).filter(x=>x.answer).map(x=>[x.id,x.answer])),[r,i,a]=$e(e.id,"answers",s),[l,c]=N.useState(!1),u=Object.keys(r).length,h=e.questions??[],m=[{from:"analyst",label:"From the Analyst, about what to build"},{from:"architect",label:"From the Architect, about how to build it"}],p=h.every(x=>{const g=r[x.id];return g?g.choice===x.inputOption||g.choice==="Other"?!!g.value?.trim():!0:!1});return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"db",children:m.map(x=>{const g=h.filter(j=>j.from===x.from);return g.length?t.jsxs("div",{className:"qblock",children:[t.jsxs("div",{className:"qgroup",children:[t.jsx(Ni,{role:x.from,small:!0}),x.label]}),g.map(j=>t.jsx(U_,{t:e,q:j,n:h.indexOf(j)+1,answer:r[j.id],onAnswer:k=>i(b=>({...b,[j.id]:k}))},j.id))]},x.from):null})}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn pri",disabled:!p||n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/answers`,body:{answers:r},done:"Answers sent. The Architect is choosing the design."},{onSuccess:a}),children:[t.jsx(qs,{size:15})," Send answers"]}),t.jsx("button",{className:"btn",disabled:n.isPending,onClick:()=>{if(u>0&&!l)return c(!0);n.mutate({path:`/api/v1/tickets/${e.id}/skip`,done:"The squad made its own guesses. You will see them in the plan."},{onSuccess:a})},children:l?`Skip and lose your ${u===1?"answer":`${u} answers`}?`:"Skip, let the squad guess"}),l&&t.jsx("button",{className:"btn quiet",onClick:()=>c(!1),children:"Keep them"}),t.jsx(Ai,{t:e,agent:"analyst",label:"Talk it through instead"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad answer ${e.id}`})]})]})}function U_({t:e,q:n,n:s,answer:r,onAnswer:i}){const a=re(),[l,c]=$e(e.id,`ask-${n.id}`,""),[u,h]=N.useState(!!l),m=()=>{l.trim()&&(a.mutate({path:`/api/v1/tickets/${e.id}/ask`,body:{questionId:n.id,text:l}}),c(""),h(!1))},p=[...n.options,"Other"];return t.jsxs("div",{className:"q",children:[t.jsxs("h4",{...ze(n.text),children:[s,". ",t.jsx(Jt,{text:n.text,dir:tt(n.text).dir})]}),(n.thread?.length||n.thinking)&&t.jsxs("div",{className:"thread",dir:tt(n.text).dir,children:[n.thread?.map((x,g)=>t.jsxs("div",{className:`msg ${x.who==="you"?"":"squad"}`,children:[t.jsx("small",{children:x.who==="you"?"You":Zs[x.who]}),t.jsx(R,{as:"div",text:x.text})]},g)),n.thinking&&t.jsxs("div",{className:"msg squad",children:[t.jsx("small",{children:Zs[n.from]}),t.jsxs("span",{className:"typing","aria-label":"Writing a reply",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]})]})]}),t.jsx("div",{className:"choices",dir:tt(n.options.join(" ")).dir,children:p.map(x=>{const g=r?.choice===x,j=x===n.inputOption||x==="Other";return t.jsxs("div",{className:`choice ${g?"on":""}`,...ze(x),role:"radio","aria-checked":g,tabIndex:0,onClick:()=>!g&&i({choice:x}),onKeyDown:k=>k.target===k.currentTarget&&k.key==="Enter"&&!g&&i({choice:x}),children:[t.jsx("span",{className:"rd"}),t.jsx(R,{text:x.replace(/:$/,"")}),j&&g&&t.jsx("input",{autoFocus:!0,dir:je(r?.value??""),value:r?.value??"",placeholder:x==="Other"?"Your answer":"Which one?",onChange:k=>i({choice:x,value:k.target.value}),onClick:k=>k.stopPropagation()})]},x)})}),u?t.jsxs("div",{className:"askrow",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:je(l),value:l,onChange:x=>c(x.target.value),placeholder:`Ask the ${Zs[n.from]} about this question`,onKeyDown:x=>x.key==="Enter"&&m()}),t.jsx("button",{className:"btn",onClick:m,disabled:!l.trim(),children:"Ask"})]}):t.jsxs("button",{className:"asklink",onClick:()=>h(!0),disabled:n.thinking,children:[t.jsx(Xn,{size:14})," Ask about this"]})]})}const H_=(e,n)=>e.part===n.part&&(e.index??0)===(n.index??0);function ad({review:e,at:n,dir:s,children:r}){const[i,a]=$e(e?.t.id??"none",`comment-${n.part}-${n.index??0}`,""),[l,c]=N.useState(i?"comment":null);if(!e)return t.jsx(t.Fragment,{children:r});const u=e.comments.map((m,p)=>({c:m,i:p})).filter(({c:m})=>H_(m,n)),h=()=>{i.trim()&&e.add({...n,text:i.trim()}),a(""),c(null)};return t.jsxs("div",{className:`part ${l?"open":""}`,dir:s,children:[t.jsxs("div",{className:"partbody",children:[t.jsx("div",{className:"partmain",children:l==="edit"?t.jsx(K_,{review:e,at:n,onDone:()=>c(null)}):r}),l!=="edit"&&t.jsxs("span",{className:"parttools",children:[t.jsx("button",{className:"iconbtn",title:"Comment on this","aria-label":"Comment on this",onClick:()=>c("comment"),children:t.jsx(Cj,{size:13})}),e.canEdit(n)&&t.jsx("button",{className:"iconbtn",title:"Edit it yourself","aria-label":"Edit it yourself",onClick:()=>c("edit"),children:t.jsx(Id,{size:13})})]})]}),u.map(({c:m,i:p})=>t.jsxs("div",{className:"pcomment",children:[t.jsx(Cj,{size:12})," ",t.jsx(R,{text:m.text}),t.jsx("button",{className:"iconbtn","aria-label":"Remove comment",onClick:()=>e.remove(p),children:t.jsx(Ue,{size:12})})]},p)),l==="comment"&&t.jsxs("div",{className:"pcomment new",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:je(i),value:i,placeholder:"Your comment on this part. Enter to add",onChange:m=>a(m.target.value),onKeyDown:m=>{m.key==="Enter"&&h(),m.key==="Escape"&&c(null)}}),t.jsx("button",{className:"btn sm",onClick:h,children:"Add"})]})]})}function K_({review:e,at:n,onDone:s}){const r=re(),i=e.t,a=n.index??0,[l,c]=$e(i.id,`edit-${n.part}-${a}`,n.part==="story"?i.story??"":n.part==="step"?i.steps?.[a]?.title??"":""),[u,h]=$e(i.id,`edit-criterion-${a}`,i.criteria?.[a]??{given:"",when:"",then:""}),m=()=>r.mutate({path:`/api/v1/tickets/${i.id}/plan/edit`,body:n.part==="criterion"?{...n,criterion:u}:{...n,text:l},done:"Edited. Your wording stays."},{onSuccess:()=>{al(ba(gt,i.id,`edit-${n.part}-${a}`)),al(ba(gt,i.id,`edit-criterion-${a}`)),s()}});return t.jsxs("div",{className:"editpart",children:[n.part==="criterion"?["given","when","then"].map(p=>t.jsxs("label",{children:[t.jsx("em",{children:p[0].toUpperCase()+p.slice(1)}),t.jsx("input",{className:"input",dir:je(u[p]),value:u[p],onChange:x=>h({...u,[p]:x.target.value})})]},p)):t.jsx("textarea",{className:"waynote",rows:n.part==="story"?3:2,autoFocus:!0,dir:je(l),value:l,onChange:p=>c(p.target.value)}),t.jsxs("div",{className:"editbtns",children:[t.jsx("button",{className:"btn sm pri",disabled:r.isPending,onClick:m,children:"Save"}),t.jsx("button",{className:"btn sm",onClick:s,children:"Cancel"})]})]})}const Nk=e=>e?`Given ${e.given}, when ${e.when}, then ${e.then}.`:"";function V_({t:e}){const[n,s]=N.useState(!0),r=e.planReview?.before;if(!r)return null;const i=[],a=(u,h="",m="")=>h!==m&&i.push({label:u,old:h,now:m});a("The story",r.story,e.story);const l=Math.max(r.criteria?.length??0,e.criteria?.length??0);for(let u=0;u<l;u++)a(`Done when ${u+1}`,Nk(r.criteria?.[u]),Nk(e.criteria?.[u]));(r.decision!==void 0||e.decision)&&a("The decision",r.decision,e.decision?`${e.decision.title}: ${e.decision.options.find(u=>u.chosen)?.name??""}`:"");const c=Math.max(r.steps?.length??0,e.steps?.length??0);for(let u=0;u<c;u++)a(`Step ${u+1}`,r.steps?.[u],e.steps?.[u]?.title);return t.jsxs("div",{className:"changed",children:[t.jsxs("button",{className:"changedhead",onClick:()=>s(!n),children:[t.jsx("b",{children:"What changed"})," ",i.length?`${i.length} ${i.length===1?"part":"parts"}`:"nothing"," since the last version ",n?"▾":"▸"]}),n&&t.jsxs(t.Fragment,{children:[(e.planReview?.sent??[]).length>0&&t.jsxs("div",{className:"sentlist",children:["Your comments:"," ",e.planReview.sent.map((u,h)=>t.jsx(R,{text:`“${u.text}”`},h))]}),i.map(u=>t.jsxs("div",{className:"chrow",children:[t.jsx("div",{className:"chlabel",children:u.label}),u.old?t.jsx(R,{as:"div",className:"chold",text:u.old}):t.jsx("div",{className:"chold empty",children:t.jsx("i",{children:"new"})}),u.now?t.jsx(R,{as:"div",className:"chnew",text:u.now}):t.jsx("div",{className:"chnew",children:t.jsx("i",{children:"removed"})})]},u.label))]})]})}function Y_({t:e,i:n}){const s=e.criteria?.[n],[r,i]=N.useState(!1);if(!s?.proof)return null;const a=s.proof,l=Y$(e);return t.jsxs(t.Fragment,{children:[a.why&&!a.locked&&t.jsx(R,{className:"kindwhy",text:a.why}),t.jsxs("div",{className:"kindpick",children:[l?t.jsx("button",{type:"button",className:"kindbtn","aria-haspopup":"menu","aria-expanded":r,"aria-label":`How "done when" ${n+1} is proved: ${Wd[a.kind]}${a.keeps?`, ${R1}`:""}. Change it`,onClick:()=>i(c=>!c),children:t.jsx(ll,{kind:a.kind,locked:a.locked,keeps:a.keeps,caret:!0})}):t.jsx(ll,{kind:a.kind,locked:a.locked,keeps:a.keeps}),a.locked&&a.why&&t.jsx(R,{as:"small",className:"kindrule",text:a.why}),r&&t.jsx(G_,{t:e,line:n+1,current:a.kind,locked:!!a.locked,why:a.why,keeps:!!a.keeps,onClose:()=>i(!1)})]})]})}function G_({t:e,line:n,current:s,locked:r,why:i,keeps:a,onClose:l}){const c=re(),u=N.useRef(null),[h,m]=N.useState(s),[p,x]=N.useState(!1),[g,j]=N.useState(s==="none"?i??"":""),[k,b]=N.useState(!1);N.useLayoutEffect(()=>{const E=u.current?.getBoundingClientRect();E&&E.bottom>window.innerHeight-12&&E.top-E.height-40>0&&b(!0)},[]),N.useEffect(()=>{const E=$=>!u.current?.contains($.target)&&l(),z=$=>$.key==="Escape"&&l();return document.addEventListener("mousedown",E),document.addEventListener("keydown",z),()=>{document.removeEventListener("mousedown",E),document.removeEventListener("keydown",z)}},[l]);const w=(E,z)=>{if(E===s&&E!=="none")return l();c.mutate({path:`/api/v1/tickets/${e.id}/prove`,body:{line:n,kind:E,...z?{why:z}:{}},done:`"Done when" ${n} is proved by ${Wd[E]} now.`},{onSuccess:l})},S=E=>c.mutate({path:`/api/v1/tickets/${e.id}/prove`,body:{line:n,kind:"test",keeps:E},done:E?`"Done when" ${n} stays as it is: its test passes before and after.`:`"Done when" ${n} changes what happens: its test fails before the change.`},{onSuccess:l}),T=s==="test"&&h==="test"&&!p;return t.jsxs("div",{className:`kindmenu${k?" up":""}`,role:"menu",ref:u,"aria-label":`How should line ${n} be proved?`,children:[t.jsxs("div",{className:"mh",children:["How should line ",n," be proved?"]}),W$.map(E=>{const z=fw[E],$=r&&E!=="screen";return t.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":E===s,className:`opt k-${E}${E===s?" on":""}${$?" off":""}`,disabled:$||c.isPending,onMouseEnter:()=>m(E),onFocus:()=>m(E),onClick:()=>E==="none"?x(!0):w(E),children:[t.jsx("span",{className:"ic",children:t.jsx(z,{"aria-hidden":"true"})}),t.jsxs("span",{children:[t.jsx("b",{children:Wd[E]}),t.jsx("small",{children:U$[E]})]}),t.jsx(ce,{className:"tick","aria-hidden":"true"})]},E)}),s==="test"&&t.jsxs("label",{className:"kindkeeps",children:[t.jsx("input",{type:"checkbox",checked:a,disabled:c.isPending,onChange:E=>S(E.target.checked),onFocus:()=>m("test")}),t.jsxs("span",{children:[t.jsxs("b",{children:["Test · ",R1]}),t.jsx("small",{children:H$})]})]}),p&&t.jsxs("div",{className:"kindwhyask",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:je(g),value:g,onChange:E=>j(E.target.value),placeholder:"Why can it not be shown? The Reviewer checks it.",onKeyDown:E=>E.key==="Enter"&&g.trim()&&w("none",g.trim())}),t.jsx("button",{type:"button",className:"btn pri sm",disabled:!g.trim()||c.isPending,onClick:()=>w("none",g.trim()),children:"Save"})]}),t.jsxs("div",{className:"mf",children:[r?t.jsx(fu,{"aria-hidden":"true"}):null,t.jsx("span",{children:r?K$:V$})]}),t.jsx("div",{className:"mcmd",children:t.jsx(X,{text:G$(e.id,n,p?"none":h,p?g.trim()||"…":void 0,T?a:void 0)})})]})}function ru({t:e,review:n}){return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The story"}),t.jsx(ad,{review:n,at:{part:"story"},dir:tt(e.story??"").dir,children:t.jsx(R,{as:"p",className:"story",text:e.story??""})}),e.criteria&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Done when"}),t.jsx("ol",{className:"ac",children:e.criteria.map((s,r)=>{const i=ze(`${s.given} ${s.when} ${s.then}`);return t.jsxs("li",{...i,children:[t.jsx(ad,{review:n,at:{part:"criterion",index:r},children:t.jsxs("span",{children:[t.jsx("em",{children:"Given"})," ",t.jsx(Jt,{text:s.given,dir:i.dir}),", ",t.jsx("em",{children:"when"})," ",t.jsx(Jt,{text:s.when,dir:i.dir}),", ",t.jsx("em",{children:"then"})," ",t.jsx(Jt,{text:s.then,dir:i.dir}),"."]})}),t.jsx(Y_,{t:e,i:r})]},r)})})]}),e.decision&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["The Architect's decision ",e.decision.adr&&t.jsxs("span",{className:"pill ok",children:["Saved as ",e.decision.adr]})]}),t.jsx(ad,{review:n,at:{part:"decision"},dir:tt(e.decision.title).dir,children:t.jsxs("div",{className:"decision",children:[t.jsxs("h3",{...ze(e.decision.title),children:[t.jsx(Ni,{role:"architect",small:!0}),t.jsx(R,{text:e.decision.title})]}),t.jsx("div",{className:"opts2",children:e.decision.options.map(s=>t.jsxs("div",{className:`opt2 ${s.chosen?"pick":""}`,...ze(`${s.name} ${s.note}`),children:[t.jsxs("b",{children:[t.jsx(R,{text:s.name}),s.chosen&&t.jsxs("span",{children:[t.jsx(ce,{size:13,strokeWidth:2.5})," Chosen"]})]}),t.jsx(R,{text:s.note})]},s.name))}),t.jsxs("div",{className:"why",children:[t.jsx(R,{lead:t.jsx("b",{children:"Why"}),text:e.decision.why}),e.decision.clientCheck&&t.jsx(R,{lead:t.jsx("b",{children:"Client's choice"}),text:e.decision.clientCheck}),e.decision.replaces&&t.jsxs("span",{children:[t.jsx("b",{children:"Replaces"})," ",e.decision.replaces,". Once you approve, it is no longer a rule and later tickets follow this one."]})]})]})})]}),e.work&&e.follows&&e.follows.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Follows saved decisions"}),t.jsx("div",{className:"pills",children:e.follows.map(s=>t.jsx(ge,{to:"/architecture",search:{adr:s},className:"pill",children:s},s))})]}),e.work&&t.jsx(L_,{t:e}),e.mockup&&e.work&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"How it will look"}),t.jsx(P1,{ticket:e.id,file:e.mockup,title:`${e.title}: mockup`})]}),e.work&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The work"}),t.jsxs("div",{className:"pills",children:[t.jsxs("span",{className:"pill",children:[e.work.steps," small steps"]}),t.jsxs("span",{className:"pill",children:[e.work.tests," new tests"]}),e.work.screens>0&&t.jsxs("span",{className:"pill",children:[e.work.screens," before and after screens"]})]})]}),e.work&&t.jsx(d5,{t:e}),n&&e.steps&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Build steps"}),t.jsx("ol",{className:"ac",children:e.steps.map((s,r)=>t.jsx("li",{...ze(s.title),children:t.jsx(ad,{review:n,at:{part:"step",index:r},children:t.jsx(R,{text:s.title})})},r))})]})]})}function Q_({t:e}){const n=re(),s=`plan-${e.waiting?.kind??"plan"}`,[r,i,a]=$e(e.id,`${s}-mode`,null),[l,c,u]=$e(e.id,`${s}-note`,""),[h,m]=N.useState(!1),[p,x,g]=$e(e.id,`${s}-comments`,[]),j=()=>{a(),u(),g()},k=e.waiting?.kind==="spec",b=!k&&!!e.specApproved,w=k?"the Analyst":b?"the Architect":"the Spec writer",S={t:e,comments:p,add:z=>x($=>[...$,z]),remove:z=>x($=>$.filter((P,L)=>L!==z)),canEdit:z=>k?z.part==="story"||z.part==="criterion":z.part==="step"||!b&&(z.part==="story"||z.part==="criterion")},T=()=>r==="over"?n.mutate({path:`/api/v1/tickets/${e.id}/plan/start-over`,body:{direction:l},done:`Starting over. ${w[0].toUpperCase()}${w.slice(1)} writes it again.`},{onSuccess:j}):n.mutate({path:`/api/v1/tickets/${e.id}/change`,body:{text:l},done:`Sent to ${w}.`},{onSuccess:j}),E=p.length;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[(k||b)&&t.jsxs("div",{className:"twostep",children:[t.jsxs("span",{className:k?"on":"done",children:[k?"1":t.jsx(ce,{size:12,strokeWidth:3})," The what"]}),t.jsx("span",{className:"bar"}),t.jsx("span",{className:b?"on":"",children:"2 The how"}),t.jsx("p",{children:k?'Is this what you want? Check the story and the "done when" list. The Architect designs how to build it after you approve.':`The spec was approved by ${e.specApproved.by}. Now check how the Architect will build it. A developer can approve this part for you.`})]}),t.jsx(V_,{t:e}),t.jsx("p",{className:"note reviewhint",children:"Point at any part to comment on it or edit it yourself. Send back sends every comment at once."}),k?t.jsx(ru,{t:{...e,decision:void 0,work:void 0},review:S}):t.jsx(ru,{t:e,review:S}),!k&&e.decision&&t.jsx("p",{className:"note",style:{marginTop:14},children:"Approved decisions are saved in Decisions. Later tickets must follow them."})]}),r?t.jsxs("div",{className:"df",children:[t.jsx("input",{className:"input",style:{flex:1},autoFocus:!0,dir:je(l),value:l,onChange:z=>c(z.target.value),placeholder:r==="over"?"What is the new direction? It is written again from zero.":"What should change? One line is enough.",onKeyDown:z=>z.key==="Enter"&&l.trim()&&!n.isPending&&T()}),t.jsx("button",{className:"btn pri",disabled:!l.trim()||n.isPending,onClick:T,children:r==="over"?"Start over":"Send"}),t.jsx("button",{className:"btn",onClick:()=>i(null),children:"Cancel"})]}):t.jsxs("div",{className:"df",children:[E>0?t.jsxs("button",{className:"btn pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/plan/send-back`,body:{comments:p},done:`Sent back to ${w} with ${E} ${E===1?"comment":"comments"}.`},{onSuccess:j}),children:[t.jsx(qs,{size:15})," Send back (",E,")"]}):t.jsxs("button",{className:"btn pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/approve`,done:k?"Spec approved. The Architect is designing how to build it.":"Plan approved. The Builder started."},{onSuccess:j}),children:[t.jsx(ce,{size:15,strokeWidth:2.5})," ",k?"Approve spec":b?"Approve design":"Approve plan"]}),E===0&&t.jsx("button",{className:"btn",onClick:()=>i("change"),children:"Change something"}),(k||b)&&t.jsx(Ai,{t:e,agent:k?"analyst":"architect",label:"Talk it through"}),t.jsx("button",{className:"btn quiet",onClick:()=>i("over"),children:"Start over"}),t.jsx("button",{className:"btn quiet",onClick:()=>m(!0),children:"Ask a developer"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:E>0?`squad send-back ${e.id} ${p.map(z=>Me(`${Z_(z)}: ${z.text}`)).join(" ")}`:`squad approve ${e.id}`})]}),h&&t.jsx(X_,{t:e,onClose:()=>m(!1)})]})}function Z_(e){return e.part==="criterion"?`done when ${(e.index??0)+1}`:e.part==="step"?`step ${(e.index??0)+1}`:e.part}function X_({t:e,onClose:n}){const{toast:s}=Le(),r=`Hi, can you check the plan for ${e.id} "${e.title}" before I approve it? It's on the board, or run: squad show ${e.id}`;return t.jsxs(Ye,{title:"Ask a developer",onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",onClick:()=>void navigator.clipboard?.writeText(r).then(()=>s("Message copied")),children:[t.jsx(Mn,{size:15})," Copy message"]}),t.jsx("button",{className:"btn",onClick:n,children:"Close"})]}),children:[t.jsx("p",{children:"Send this to a developer on your team. They can read the plan in the terminal and tell you what they think."}),t.jsx(R,{as:"div",className:"wa",text:r})]})}function J_(e){if(!e)return"";const n=(s,r)=>s?`${s} ${s===1?"row":"rows"} ${r}`:"";return[n(e.changed.length,"changed"),n(e.added.length,"added"),n(e.removed.length,"removed")].filter(Boolean).join(", ")||"No row changed"}function eD(e){const n=e.before?.rows??[],s=e.after?.rows??[],r=a=>a[e.key]??"",i=[];for(const a of n){const l=s.find(u=>r(u)===r(a));if(!l){i.push({label:e.after?"−":"Before",row:a,changed:[]});continue}const c=e.changes?.changed.find(u=>u.key===r(a))?.columns??[];if(!c.length&&e.after){i.push({label:"Same",row:l,changed:[]});continue}i.push({label:"Before",row:a,changed:[]},{label:"After",row:l,changed:c})}for(const a of s)n.some(l=>r(l)===r(a))||i.push({label:e.before?"+":"After",row:a,changed:[]});return i}function tD({file:e}){const s=ve({queryKey:["rows-proof",e],queryFn:async()=>(await fetch(Mt(`/api/v1/proof/${e}`))).json()}).data;if(!s||!Array.isArray(s.columns))return null;const r=eD(s);return t.jsxs("div",{className:"datarows",dir:"ltr",children:[t.jsx("span",{className:"tname",children:s.table}),t.jsx("div",{className:"rowscroll",children:t.jsxs("table",{className:"rows",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{}),s.columns.map(i=>t.jsx("th",{children:i},i))]})}),t.jsxs("tbody",{children:[r.map((i,a)=>t.jsxs("tr",{className:i.label==="After"?"after":i.label==="+"?"new":i.label==="−"?"gone":"",children:[t.jsx("td",{className:"w",children:i.label}),s.columns.map(l=>t.jsx("td",{className:i.changed.includes(l)?"ch":void 0,...ze(i.row[l]??""),children:i.row[l]??"–"},l))]},a)),!r.length&&t.jsx("tr",{children:t.jsx("td",{className:"w",colSpan:s.columns.length+1,children:"No rows"})})]})]})})]})}function nD(e){const n=ve({queryKey:["rows-proof",e],queryFn:async()=>(await fetch(Mt(`/api/v1/proof/${e}`))).json()}),s=J_(n.data?.changes);return`Read from this story's own database, read only.${s?` ${s}.`:""}`}function v5({t:e}){const[n,s]=N.useState(null),r=e.proof??[],{pictures:i,starts:a}=b1(r,l=>Mt(`/api/v1/proof/${l}`));return t.jsxs(t.Fragment,{children:[n!==null&&t.jsx(zs,{pictures:i,start:n,onClose:()=>s(null)}),t.jsx("div",{className:"kindgrid",children:r.map((l,c)=>t.jsx(sD,{p:l,i:c,first:a[c]??0,onOpen:s},l.criterion))}),t.jsx(nu,{t:e})]})}function sD({p:e,i:n,first:s,onOpen:r}){const i=pw(e),a=e.shows&&e.shows!=="met"?ka(e):"";return t.jsxs("section",{className:`pf ${Nu(e.shows)}`,style:{"--i":n},...ze(e.criterion),children:[t.jsxs("div",{className:"ph",children:[t.jsx(Mg,{shows:e.shows}),t.jsx(R,{as:"b",text:e.criterion}),t.jsx(ll,{kind:i,keeps:e.test?.keeps}),t.jsx(tu,{shows:e.shows})]}),a&&t.jsx(R,{as:"p",className:"verdictnote",text:a}),i==="screen"&&t.jsx(rD,{p:e,first:s,onOpen:r}),i==="api"&&t.jsx(Uu,{file:e.after,...e.note?{note:e.note}:{}}),i==="data"&&t.jsx(iD,{p:e}),i==="test"&&t.jsx(aD,{p:e}),i==="none"&&t.jsx(oD,{p:e})]})}function rD({p:e,first:n,onOpen:s}){return t.jsxs(t.Fragment,{children:[nr(e)&&t.jsxs("p",{className:"cap",children:["Page ",t.jsx("code",{children:nr(e)})]}),t.jsxs("div",{className:"proofmini",children:[t.jsxs("div",{className:e.beforeDevice?"ondevice":void 0,children:[t.jsx(R,{as:"small",text:e.beforeLabel}),t.jsx("button",{className:"zoom",onClick:()=>s(n),"aria-label":`Open ${e.beforeLabel} full size`,children:t.jsx("img",{src:Mt(`/api/v1/proof/${e.before}`),alt:`${e.criterion}, ${e.beforeLabel}`})})]}),t.jsxs("div",{className:e.device?"ondevice":void 0,children:[t.jsx(R,{as:"small",text:e.afterLabel}),t.jsx("button",{className:"zoom",onClick:()=>s(n+1),"aria-label":`Open ${e.afterLabel} full size`,children:t.jsx("img",{src:Mt(`/api/v1/proof/${e.after}`),alt:`${e.criterion}, ${e.afterLabel}`})})]})]}),e.note&&t.jsx(R,{as:"p",className:"cap",text:e.note}),t.jsx(Og,{shot:e,first:n+2,onOpen:s})]})}function iD({p:e}){const n=nD(e.after);return t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"cap",children:n}),t.jsx(tD,{file:e.after}),e.note&&t.jsx(R,{as:"p",className:"cap",text:e.note})]})}function aD({p:e}){const n=e.test;if(!n)return e.note?t.jsx(R,{as:"p",className:"cap",text:e.note}):null;const s=n.before==="failed",r=n.keeps&&n.before==="passed"&&n.after==="passed";return t.jsxs(t.Fragment,{children:[t.jsx("ul",{className:"tsteps",children:n.steps.map((i,a)=>t.jsxs("li",{children:[t.jsx(ce,{"aria-hidden":"true"}),t.jsx(R,{text:i})]},a))}),t.jsxs("div",{className:"redgreen",children:[r?t.jsx("span",{children:hw}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:s?"r":"q",children:s?"It failed before the change":n.before==="passed"?"It passed before the change too":"It could not run on the old code"}),t.jsx("span",{children:n.after==="passed"?"and passes now":n.after==="failed"?"and fails now":"and could not run now"})]}),n.after==="passed"&&t.jsx("span",{className:"g",children:t.jsx(ce,{"aria-hidden":"true"})}),n.seconds!==void 0&&t.jsxs("bdi",{dir:"ltr",children:[n.seconds," s"]})]}),t.jsx("small",{className:"tname",dir:"ltr",title:n.file,children:n.name||n.file})]})}function oD({p:e}){return t.jsxs(t.Fragment,{children:[e.note&&t.jsx(R,{as:"p",className:"cap",lead:t.jsx("b",{children:"Why no proof to show:"}),text:e.note}),e.checked?t.jsxs("div",{className:"checked",children:[t.jsx(ce,{"aria-hidden":"true"}),t.jsx(R,{text:e.checked})]}):t.jsx("p",{className:"cap",children:mw(e,"none")})]})}function Bg({t:e}){const n=e.gates;return e.outside&&e.waiting?.kind==="proof"&&Wu(n)?t.jsxs("div",{className:"pills",children:[t.jsx(us,{state:"pending",text:"Checks not run"}),t.jsx(us,{state:"pending",text:"No review"}),t.jsx(us,{state:"pending",text:"No proof"})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"pills",children:[t.jsx(us,{state:n?.checks,text:u5(n)}),t.jsx(us,{state:n?.review,text:n?.review==="pass"?`Review approved by ${n.reviewBy}`:n?.review==="skipped"?"Review notes open, you continued":"Review approved"}),t.jsx(us,{state:n?.proof,text:p5(e)})]}),t.jsx(g5,{g:n}),t.jsx(f5,{g:n}),e.overrides?.map(s=>t.jsxs("p",{className:"note override",children:[t.jsx("b",{children:"Continued anyway"})," past the ",v_(s),", by ",t.jsx(R,{text:s.by}),": ",t.jsx(R,{text:s.reason})]},s.at))]})}function Wg({t:e}){if(ol(e))return t.jsx(v5,{t:e});const[n,s]=N.useState(null);if(!e.proof?.length)return t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note",children:m5(e)}),t.jsx(nu,{t:e})]});const{pictures:r,starts:i}=b1(e.proof,a=>Mt(`/api/v1/proof/${a}`));return t.jsxs(t.Fragment,{children:[n!==null&&t.jsx(zs,{pictures:r,start:n,onClose:()=>s(null)}),e.proof.map((a,l)=>t.jsxs("div",{className:`critrow ${Nu(a.shows)}`,children:[t.jsxs("h5",{...ze(a.criterion),children:[t.jsx(Mg,{shows:a.shows}),t.jsx(R,{text:a.criterion}),t.jsx(tu,{shows:a.shows})]}),ka(a)&&t.jsx(R,{as:"p",className:"verdictnote",text:ka(a)}),nr(a)&&t.jsxs("p",{className:"critpage",children:["Page ",t.jsx("code",{children:nr(a)})]}),_d(a.after)?t.jsx(Uu,{file:a.after,...a.note?{note:a.note}:{}}):t.jsxs("div",{className:"proofmini",children:[t.jsxs("div",{className:a.beforeDevice?"ondevice":void 0,children:[t.jsx(R,{as:"small",text:a.beforeLabel}),t.jsx("button",{className:"zoom",onClick:()=>s(i[l]),"aria-label":`Open ${a.beforeLabel} full size`,children:t.jsx("img",{src:Mt(`/api/v1/proof/${a.before}`),alt:`${a.criterion}, ${a.beforeLabel}`})}),a.beforeDevice&&t.jsx("small",{className:"shotdevice",children:a.beforeDevice})]}),t.jsxs("div",{className:a.device?"ondevice":void 0,children:[t.jsx(R,{as:"small",text:a.afterLabel}),t.jsx("button",{className:"zoom",onClick:()=>s(i[l]+1),"aria-label":`Open ${a.afterLabel} full size`,children:t.jsx("img",{src:Mt(`/api/v1/proof/${a.after}`),alt:`${a.criterion}, ${a.afterLabel}`})}),a.device&&t.jsx("small",{className:"shotdevice",children:a.device})]})]}),a.more?.length&&a.why&&a.note?t.jsx(R,{as:"p",className:"note proofmore-main",text:a.note}):null,t.jsx(Og,{shot:a,first:i[l]+2,onOpen:s})]},a.criterion)),t.jsx(nu,{t:e})]})}function b5({t:e,sticky:n}){const s=re(),[r,i,a]=$e(e.id,"proof-wrong",""),[l,c]=N.useState(!!r),u=()=>{s.isPending||s.mutate({path:`/api/v1/tickets/${e.id}/change`,body:{text:r},done:"Sent back to the Builder with your note."},{onSuccess:a})};return l?t.jsxs("div",{className:n?"stickybar":"df",children:[t.jsx("input",{className:"input",style:{flex:1},autoFocus:!0,dir:je(r),value:r,onChange:h=>i(h.target.value),placeholder:"What's wrong? Tell the squad in one line.",onKeyDown:h=>h.key==="Enter"&&r.trim()&&u()}),t.jsx("button",{className:"btn pri",disabled:!r.trim()||s.isPending,onClick:u,children:"Send back"}),t.jsx("button",{className:"btn",onClick:()=>c(!1),children:"Cancel"})]}):t.jsxs("div",{className:n?"stickybar":"df",children:[t.jsxs("button",{className:"btn pri",disabled:s.isPending,onClick:()=>s.mutate({path:`/api/v1/tickets/${e.id}/approve`,done:h=>h.stage==="release"?`${e.id} is ready to release.`:h.live?"Newer work changed the same code meanwhile, so the Builder brings it in first. Then the proof comes back to you.":null}),children:[s.isPending?t.jsx(Xe,{size:15,className:"spin"}):t.jsx(ce,{size:15,strokeWidth:2.5})," ",s.isPending?"Saving…":"Looks right"]}),t.jsx("button",{className:"btn",onClick:()=>c(!0),children:"Something's wrong"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad approve ${e.id}`})]})}function lD({t:e}){return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:t.jsx(ce,{size:18,strokeWidth:2.5})}),t.jsxs("div",{children:[t.jsx("b",{children:"Check that it works the way you want"}),t.jsx("span",{children:k_(e.gates)})]}),t.jsx("span",{className:"grow"}),t.jsxs(ge,{to:"/tickets/$id/proof",params:{id:e.id},className:"btn sm",children:[t.jsx(Xt,{size:14})," Full page"]})]}),t.jsx("div",{className:"lbl",children:"Gates, checked by squad-kit"}),t.jsx(Bg,{t:e}),t.jsx(_a,{t:e}),t.jsx("div",{className:"lbl",children:q1(e,"Before and after")}),t.jsx(Wg,{t:e}),t.jsx(su,{t:e})]}),t.jsx(b5,{t:e})]})}function cD({t:e}){const n=re(),[s,r]=N.useState(!1),i=e.agentQuestion,a=i.port,l=i.options.find(h=>h==="Stop it"),c=i.options.find(h=>h!=="Stop it"),u=(h,m)=>n.mutate({path:`/api/v1/tickets/${e.id}/reply`,body:{text:h},done:m},{onSettled:()=>r(!1)});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:"?"}),t.jsxs("div",{children:[t.jsx("b",{children:"Another program is in the way"}),t.jsx("span",{children:"You decide. Nothing is stopped unless you press Stop it."})]})]}),t.jsx("div",{className:"lbl",children:"What is in the way"}),t.jsx(R,{as:"p",className:"stuckq",text:i.text}),i.why&&t.jsx(R,{as:"p",className:"note",text:i.why}),t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"Details for engineers"}),t.jsxs("p",{className:"note",children:[a.program||"A program",a.pid?` (process ${a.pid})`:", which the system does not name,",a.port?` listens on port ${a.port}`:"",a.app?`: your app ${a.app}, which squad-kit runs from Your apps`:"","."]}),t.jsxs("p",{className:"note",children:["The Builder asked: “",a.asked,"”"]})]})]}),t.jsxs("div",{className:"df",children:[l&&t.jsx("button",{className:"btn pri",disabled:n.isPending,onClick:()=>r(!0),children:l}),c&&t.jsx("button",{className:`btn ${l?"":"pri"}`,disabled:n.isPending,onClick:()=>u(c,"Sent. The Builder carries on without it."),children:c}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad reply ${e.id} ${Me(l??c??"")}`})]}),s&&l&&t.jsxs(Ye,{title:a.app?`Stop your app ${a.app}?`:"Stop that program?",onClose:()=>r(!1),footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:n.isPending,onClick:()=>u(l,"Stopping it. The Builder carries on."),children:n.isPending?"Stopping it…":"Stop it"}),t.jsx("button",{className:"btn",onClick:()=>r(!1),children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad reply ${e.id} ${Me(l)}`})]}),children:[t.jsxs("p",{children:["squad-kit stops ",a.app?`your app ${a.app}`:"that program",", then the Builder carries on. ",a.app?"You can start it again from Your apps afterwards.":"Anything not saved in that program is lost."]}),t.jsx("p",{className:"note",children:"squad-kit checks again first that it is still the same program."})]})]})}function w5(e){return!!(e.now&&(e.now.state==="working"||e.now.state==="queued"||e.now.state==="stopping"))}function dD(e){const n=Math.max(0,Math.floor((Date.now()-Date.parse(e))/1e3));if(n<2)return"just now";if(n<60)return`${n} seconds ago`;const s=Math.floor(n/60);return`${s} minute${s===1?"":"s"} ago`}function N5({bar:e,big:n}){return e?.length?t.jsx("div",{className:`segbar ${n?"big":""}`,"aria-hidden":!0,children:e.map((s,r)=>t.jsx("span",{className:s==="done"?"d":s==="now"?"n":""},r))}):null}function uD({t:e}){const n=e.now;if(n.state==="queued")return t.jsx(R,{as:"div",className:"nl1 quiet",text:n.line});const[s,...r]=n.line.split(" · "),i=n.slow;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"nl1",children:[t.jsx("span",{className:"live"}),t.jsx(R,{lead:t.jsx("b",{children:s}),text:r.length?`· ${r.join(" · ")}`:""})]}),i?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:`nl2 slow ${i.kind} ${i.calm?"still":""}`,children:[i.kind==="stuck"?t.jsx(Is,{size:12}):t.jsx(i1,{size:12}),t.jsx("span",{children:i.kind==="stuck"?"Looks stuck":i.line??"Longer than usual"})]}),i.note&&t.jsx(R,{as:"div",className:"nl3",text:i.note})]}):n.time&&t.jsx("div",{className:"nl2",children:n.time}),t.jsx(N5,{bar:n.bar})]})}function S5({t:e}){const n=e.now,s=n.state==="queued"?"Next in line":n.state==="stopping"?"Stopping":"Working",[r,...i]=(n.detail??"").split(" · ");return t.jsxs("section",{className:"nowcard","aria-label":"What is happening now",children:[t.jsxs("div",{className:"nowhead",children:[n.state==="working"&&t.jsx("span",{className:"live"}),t.jsxs("span",{children:[s,n.state==="working"&&n.lastAt?` · last update ${dD(n.lastAt)}`:""]})]}),t.jsx(R,{as:"p",className:"nowsay",text:n.sentence}),n.detail&&(n.part?t.jsx(R,{as:"div",className:"nowmeta",lead:t.jsx("b",{children:r}),text:i.length?`· ${i.join(" · ")}`:""}):t.jsx(R,{as:"div",className:"nowmeta",text:n.detail})),t.jsx(N5,{bar:n.bar,big:!0}),n.next&&t.jsx(R,{as:"div",className:"nownext",lead:t.jsx("b",{children:"What comes next:"}),text:n.next})]})}function C5({t:e}){const n=e.now?.role==="squad"?"tester":e.now?.role,s=n?e.activity.filter(a=>a.who===n):[],r=(s.length>=2?s:e.activity).slice(0,6);if(!r.length)return null;const i=s.length>=2&&n?Zs[n]:"squad";return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["What the ",i," did, in plain words"]}),t.jsx("div",{className:"feed",children:r.map((a,l)=>t.jsxs("div",{className:"fe",children:[t.jsx("span",{className:"tm",children:tn(a.at)}),t.jsx(Ni,{role:a.who,small:!0}),t.jsx(R,{text:a.text})]},a.at+l))})]})}function hD({t:e}){const n=re(),[s,r]=N.useState(!1),i=e.now?.slow,a=n.isPending||e.stopRequested;if(!i)return null;const l=i.kind==="stuck",c=!l&&!!i.calm,u=()=>n.mutate({path:`/api/v1/tickets/${e.id}/keep-waiting`,body:{minutes:10},done:"OK. squad-kit stays quiet about it for 10 minutes."}),h=()=>n.mutate({path:`/api/v1/tickets/${e.id}/restart`,done:"Stopping the step. It starts again at once, with the work so far."}),m=()=>n.mutate({path:`/api/v1/tickets/${e.id}/stop`,done:"Stopping. The work so far is kept."}),p=()=>n.mutate({path:`/api/v1/tickets/${e.id}/unstick`,done:"Ended the stuck command. The squad carries on."}),x=()=>n.mutate({path:`/api/v1/tickets/${e.id}/free-port`,done:"Stopped it. The step starts again, with the work so far."},{onSettled:()=>r(!1)});return t.jsxs("section",{className:`slowcard ${l?"stuck":c?"still":""}`,"aria-label":i.title,children:[t.jsxs("div",{className:"slowhead",children:[l?t.jsx(Is,{size:17}):t.jsx(i1,{size:17}),t.jsx("b",{children:i.title}),t.jsx("span",{className:"grow"}),t.jsx("span",{className:"where",children:i.where})]}),t.jsxs("div",{className:"slowbody",children:[t.jsx(R,{as:"p",className:"slowsay",text:i.text}),t.jsx("div",{className:"facts",children:i.facts.map(g=>t.jsxs("div",{className:"fact",children:[t.jsx("span",{children:g.label}),t.jsx(R,{text:g.value})]},g.label))}),t.jsxs("div",{className:"ways",children:[i.freePort&&t.jsx("button",{className:"btn pri",disabled:a,onClick:()=>r(!0),children:"Stop it and try again"}),l&&i.canEnd&&!i.freePort&&t.jsx("button",{className:"btn pri",disabled:a,onClick:p,children:"End the stuck command"}),!l&&t.jsx("button",{className:`btn ${c?"":"you"}`,disabled:a,onClick:u,children:"Give it 10 more minutes"}),t.jsx("button",{className:"btn",disabled:a,onClick:h,children:"Stop and try again"}),l&&t.jsx("button",{className:"btn",disabled:a,onClick:u,children:"Keep waiting"}),t.jsxs("button",{className:"btn",disabled:a,onClick:m,children:[t.jsx(Jn,{size:12})," Stop"]}),t.jsx(Sg,{t:e,problem:l?"stuck":"slow"})]}),l&&i.canEnd&&t.jsx("p",{className:"note slownote",children:"Ending the command gives the squad an error back, and it carries on in the same conversation."}),i.detail&&t.jsxs("details",{className:"costdetails slownote",children:[t.jsx("summary",{children:"Details for engineers"}),t.jsx("p",{className:"note",style:{whiteSpace:"pre-line",overflowWrap:"anywhere"},children:i.detail})]}),t.jsxs("div",{className:"slowfoot",children:[t.jsx("span",{children:l&&i.limit||"Nothing is lost whatever you choose."}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:i.freePort?`squad unstick ${e.id} --free-port`:l&&i.canEnd?`squad unstick ${e.id}`:`squad wait ${e.id} --more 10m`})]})]}),s&&i.freePort&&t.jsxs(Ye,{title:"Stop it and try again?",onClose:()=>r(!1),footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:n.isPending,onClick:x,children:n.isPending?"Stopping it…":"Stop it and try again"}),t.jsx("button",{className:"btn",onClick:()=>r(!1),children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad unstick ${e.id} --free-port`})]}),children:[t.jsxs("p",{children:["squad-kit stops ",i.freePort.what,", then starts this step again."," ",i.freePort.what.startsWith("your app")?"You can start it again from Your apps afterwards.":"squad-kit started that program itself, so nothing of yours is closed."]}),t.jsx("p",{className:"note",children:"The work so far is kept. squad-kit checks again that it started the program before it stops it."})]})]})}function $5({t:e}){const[n,s]=$e(e.id,"status-ask",""),[r,i]=N.useState([]),[a,l]=N.useState(!1),c=async()=>{const h=n.trim();if(!(!h||a)){l(!0);try{const m=await et(`/api/v1/tickets/${e.id}/status/ask`,"POST",{text:h});i(p=>[...p,{q:h,a:m,at:new Date().toISOString()}]),s("")}catch(m){i(p=>[...p,{q:h,error:m instanceof Error?m.message:String(m),at:new Date().toISOString()}])}finally{l(!1)}}},u=tt(n).dir;return t.jsxs("section",{className:"askbox","aria-label":"Ask about this ticket",children:[t.jsx("label",{htmlFor:`ask-${e.id}`,className:"lbl",children:"Ask about this ticket"}),r.length>0&&t.jsx("div",{className:"askthread",children:r.map((h,m)=>t.jsx(pD,{t:e,said:h},h.at+m))}),t.jsxs("div",{className:"askrow",children:[t.jsx("input",{id:`ask-${e.id}`,className:"input",dir:u,value:n,onChange:h=>s(h.target.value),onKeyDown:h=>h.key==="Enter"&&void c(),placeholder:"For example: is there a problem? when will it be ready?"}),t.jsxs("button",{className:"btn pri",disabled:!n.trim()||a,onClick:()=>void c(),children:[t.jsx(qs,{size:14})," Ask"]})]}),t.jsxs("div",{className:"askfoot",children:[t.jsx("span",{children:"Status answers come at once, in English or Arabic, with no AI cost. Questions for an agent reach it at its next safe moment."}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad status ${e.id}`})]})]})}function pD({t:e,said:n}){const s=n.a,r=s?.lang==="ar";return t.jsxs("div",{className:"askturn",children:[t.jsx(R,{as:"div",className:"askme",text:n.q}),t.jsxs("div",{className:`askit ${r?"ar":""}`,dir:r?"rtl":"ltr",lang:r?"ar":"en",children:[t.jsxs("div",{className:"who",children:[t.jsx("b",{children:"squad-kit"}),s?.instant&&t.jsx("span",{className:"tag",children:r?"إجابة فورية":"answered at once"}),t.jsx("span",{className:"note",children:tn(n.at)})]}),n.error?t.jsx("p",{className:"err",children:n.error}):s?.lines.map((i,a)=>t.jsx("p",{children:t.jsx(Jt,{text:i,dir:r?"rtl":"ltr"})},a)),s&&s.offers.length>0&&t.jsx("div",{className:"askoffers",children:s.offers.map(i=>t.jsx(mD,{t:e,o:i,question:n.q},i.do+i.label))})]})]})}function mD({t:e,o:n,question:s}){const r=re(),{toast:i}=Le(),[a,l]=N.useState(!1),[c,u]=N.useState(!1);switch(n.do){case"propose":return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn sm offer",onClick:()=>l(!0),children:[t.jsxs("span",{className:"ol",children:[t.jsx(Ps,{size:13})," ",n.label]}),t.jsx("span",{className:"on",children:n.note})]}),a&&t.jsx(Rl,{t:e,initial:s,onClose:()=>l(!1)})]});case"note":return t.jsxs("button",{className:"btn sm offer",disabled:c||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/notes`,body:{text:s,...n.to?{to:n.to}:{}}},{onSuccess:()=>{u(!0),i(`Sent. ${n.note}`)}}),children:[t.jsxs("span",{className:"ol",children:[t.jsx(qs,{size:13})," ",c?"Sent":n.label]}),t.jsx("span",{className:"on",children:n.note})]});case"chat":return t.jsx(Ai,{t:e,agent:n.to,label:n.label});case"stop":return t.jsxs("button",{className:"btn sm",disabled:r.isPending||e.stopRequested,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/stop`,done:"Stopping. The work so far is kept."}),children:[t.jsx(Jn,{size:12})," ",n.label]})}}function T5(){return N.useSyncExternalStore(z9,L9)}function fD({block:e}){const n=e.link.split("#")[1],s=e.tools.length>1;return t.jsxs("div",{className:"tl-block",role:"status",children:[e.checking||!e.tools[0]?t.jsx("span",{className:"ring",children:e.checking?t.jsx(Xe,{size:16,className:"spin"}):t.jsx(sl,{size:16})}):t.jsx(Rg,{id:e.tools[0].id,name:e.tools[0].name,size:34}),t.jsxs("div",{children:[t.jsx("b",{children:e.checking?"Checking this computer's tools":`Waits for ${s?"tools":"a tool"} on this computer`}),t.jsxs("span",{children:[e.text," ",e.checking?"It goes on in a moment.":`Nothing failed: it goes on by itself once ${s?"they're":"it's"} there.`]})]}),t.jsx("span",{className:"grow"}),t.jsx(ge,{to:"/tools",hash:n,className:"btn sm",children:"See what's needed"})]})}function gD({s:e}){const n=e.into?`${e.into} on ${e.host}`:e.host?`your repo on ${e.host}`:"your code host";return t.jsxs("div",{className:"ob-card sendas",children:[t.jsx("span",{className:"ob-ring",children:t.jsx(mu,{size:16})}),t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:"Send it as a pull request"}),t.jsxs("span",{children:["It is merged on this computer, on branch ",t.jsx("code",{children:e.branch}),". Push the branch to your copy (",e.remote,"), then open the pull request to ",n,"."]}),t.jsx(X,{text:`cd ${Ci(e.dir)} && ${e.push}`,keep:e.push,always:!0})]}),e.page&&t.jsxs("a",{className:"btn pri",href:e.page,target:"_blank",rel:"noreferrer",children:["Open the pull request page ",t.jsx(Xt,{size:14})]})]})}function E5({t:e}){return t.jsxs("div",{className:"calm",role:"status",children:[t.jsx("span",{className:"ring",children:t.jsx(Xe,{size:18,className:"spin"})}),t.jsxs("div",{children:[t.jsx(R,{as:"b",text:e.now.line}),t.jsx(R,{text:e.now.sentence})]})]})}function xD({t:e}){return t.jsxs("div",{className:"db",children:[t.jsx(E5,{t:e}),t.jsx(Or,{t:e})]})}function yD({t:e}){return t.jsxs("div",{className:"db",children:[t.jsx(hD,{t:e}),e.now&&t.jsx(S5,{t:e}),t.jsx(C5,{t:e}),t.jsx($5,{t:e})]})}function jD({t:e}){const n=re(),s=e.localSetup,r=s.status==="pending"||s.status==="running";return t.jsxs("div",{className:`localsetup ${s.status}`,children:[t.jsx("span",{className:"ic",children:r?t.jsx(Xe,{size:15,className:"spin"}):s.status==="done"?t.jsx(ce,{size:15,strokeWidth:2.5}):t.jsx(Is,{size:15})}),t.jsxs("div",{children:[t.jsx("b",{children:r?"Updating your copy of the code":s.status==="done"?"Your copy of the code is ready to run":"Your copy of the code needs a hand"}),t.jsx("span",{children:r?"The merge changed your own folder, so the squad installs new packages and runs the database changes there.":s.status==="done"?`New packages and database changes are in your own folder${s.at?`, ${st(s.at)}`:""}${s.seconds!==void 0?` (${s.seconds} s)`:""}.`:"squad-kit could not finish setting it up. Try again, or ask an engineer to look at what failed."}),s.status==="failed"&&t.jsxs("details",{className:"costdetails",children:[t.jsx("summary",{children:"See what failed"}),t.jsx("code",{children:s.command}),s.output&&t.jsx("pre",{children:s.output})]})]}),s.status==="failed"&&t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/local-setup`,done:"Running the setup again"}),children:"Try again"})]})}function _f({t:e}){const n=T5(),s=Ei(),r=re(),i=re(),a=zg(e),l=e.stage==="release"?/^Waits to merge\b/.test(e.status)?{title:"Waits to merge",text:"Your own copy of the code has changes in the same files. Save or undo them there, and it goes in by itself. squad-kit tries again every few minutes."}:e.sendAs?{title:"Merged on this computer",text:"It goes on as a pull request: send it below."}:{title:`Ready for ${e.release}`,text:"It goes out with the next release. Nothing needed from you until then."}:e.stage==="done"?{title:e.status,text:"This ticket is live. Found a problem? Report a bug and it comes back around."}:e.waiting?.kind==="change"?{title:"The Builder paused for your change",text:"The Architect updated the design. Approve it above, or decline the change and the Builder carries on."}:e.waitsToStart?{title:"Waits for you to start it",text:"squad-kit made this story. Nothing runs and nothing is spent until you press Start. Then the Analyst reads it, as with any new story."}:{title:"Nothing needed from you",text:`${vD(e)} You'll get a card when the squad needs you.`},c=w5(e);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[e.toolWait?t.jsx(fD,{block:e.toolWait}):c?t.jsx(S5,{t:e}):e.now?.merging?t.jsx(E5,{t:e}):t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:e.stage==="release"?t.jsx(Zn,{size:18}):t.jsx(ce,{size:18,strokeWidth:2.5})}),t.jsxs("div",{children:[t.jsx(R,{as:"b",text:l.title}),t.jsx(R,{text:l.text})]}),e.stage==="release"&&!e.sendAs&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"grow",style:{flex:1}}),t.jsx(ge,{to:"/releases",className:"btn sm",children:"Open release"})]})]}),e.localSetup&&t.jsx(jD,{t:e}),e.sendAs&&t.jsx(gD,{s:e.sendAs}),e.stage==="release"&&!e.mergedAt&&!c&&!e.live&&!e.squad&&(e.pr||/^Waits to merge\b/.test(e.status))&&t.jsx(Dg,{t:e,text:e.pr?`Pull request ${e.pr.id} is not merged yet. squad-kit asks the code host by itself every few minutes, or now:`:"squad-kit tries again by itself every few minutes, or now:"}),e.steps&&e.steps.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Steps"}),t.jsx(A5,{t:e})]}),e.gates&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Gates, checked by squad-kit"}),t.jsx(Bg,{t:e})]}),t.jsx(_a,{t:e}),(e.stage==="release"||e.stage==="done")&&e.usage?.length?t.jsx(sO,{t:e}):null,t.jsx(fg,{t:e}),c?t.jsx(C5,{t:e}):t.jsx(Or,{t:e}),t.jsx($5,{t:e})]}),t.jsxs("div",{className:"df",children:[e.live&&e.stage!=="release"&&e.stage!=="done"&&t.jsxs("button",{className:"btn sm",disabled:e.stopRequested||r.isPending,onClick:()=>r.mutate({path:`/api/v1/tickets/${e.id}/stop`,done:"Stopping the squad"}),children:[t.jsx(Jn,{size:12})," ",e.stopRequested?"Stopping…":"Stop"]}),e.waitsToStart&&t.jsxs("button",{className:"btn pri sm",disabled:i.isPending,onClick:()=>i.mutate({path:`/api/v1/tickets/${e.id}/start`,done:`${e.id} started`}),children:[t.jsx(kn,{size:12})," Start"]}),z1(e)&&t.jsx(M1,{t:e}),t.jsx(M_,{t:e}),!e.chat?.open&&!e.takenOver&&!tr(e)&&a!=="analyst"&&t.jsx(Ai,{t:e,agent:"analyst",label:"Ask the Analyst"}),(ln(e,s)||!s)&&t.jsx(RT,{t:e}),t.jsx("span",{className:"note",children:e.live?n==="down"?"Not updating: squad-kit has stopped.":"Updates live as the squad works.":""}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:e.waitsToStart?`squad start ${e.id}`:e.live&&e.stage!=="release"?`squad stop ${e.id}`:g1(e)})]})]})}function kD({t:e}){const n=re(),[s,r,i]=$e(e.id,"give-back",""),a=e.takenOver;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:t.jsx(bl,{size:15})}),t.jsxs("div",{children:[t.jsx("b",{children:"You have this ticket"}),t.jsx("span",{children:"The squad stopped and waits. Nothing runs until you give it back."})]})]}),t.jsx("div",{className:"lbl",children:"1. Open the Builder's session in Claude Code"}),t.jsx(X,{text:`cd ${Me(a.cwd)} && claude --resume ${a.session}`}),t.jsx("p",{className:"note",style:{fontSize:12.5,marginTop:6},children:"It is the same conversation the Builder had, in the ticket's own copy of the code. Your folder is not touched. Or just edit the files:"}),t.jsx(Fu,{t:e}),t.jsx("div",{className:"lbl",children:"2. Give it back"}),t.jsx("textarea",{className:"waynote",rows:2,dir:je(s),value:s,onChange:l=>r(l.target.value),placeholder:"What did you change? (optional, every agent reads it)"}),t.jsx("p",{className:"note",style:{fontSize:12.5},children:"Then squad-kit runs the checks, the Reviewer reads all the changes, yours too, and the Tester makes the proof again."}),t.jsx(Or,{t:e})]}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/give-back`,body:{note:s},done:"Given back. The checks run on your changes."},{onSuccess:i}),children:[t.jsx(ce,{size:15,strokeWidth:2.5})," Give back"]}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad give-back ${e.id}${s.trim()?` ${Me(s.trim())}`:""}`})]})]})}function vD(e){const n=e.steps??[],s=n.findIndex(r=>r.status==="doing");return e.stage==="implement"&&s>=0?`The Builder is on step ${s+1} of ${n.length}.`:e.stage==="test"?"squad-kit is running the project checks.":e.stage==="review"?"The Reviewer is checking the work.":e.stage==="tickets"?"The Analyst is reading the ticket.":e.stage==="specs"?"The Architect is writing the plan.":`${e.status}.`}function A5({t:e}){return t.jsx("ul",{className:"steps",children:e.steps.map((n,s)=>t.jsxs("li",{className:n.status==="doing"?"now":n.status==="todo"?"todo":"",...ze(n.title),children:[t.jsx("span",{className:`sd ${n.status==="done"?"ok":n.status==="doing"?"now":""}`,children:n.status==="done"&&t.jsx(ce,{size:11,strokeWidth:3})}),t.jsxs("span",{children:[t.jsx(R,{as:n.status==="doing"?"b":"span",style:n.status==="doing"?{fontWeight:600}:void 0,text:n.title}),n.live&&t.jsxs("span",{className:"livetxt",children:[t.jsx("span",{className:"live"}),t.jsx(R,{text:n.live})]})]}),t.jsx("span",{className:"time",dir:"ltr",children:n.status==="done"?`${n.minutes??1} min`:n.status==="doing"?"now":""})]},s))})}const bD=/^(Reading|Running|Editing|Writing|Looking|Searching|Listing|Runs on|Started step|Finished step|Stopped a program|Setting up squad-kit's screenshot browser)\b|^squad-kit (asked|ran|started|stopped|is running)\b/;function Or({t:e,all:n}){const[s,r]=N.useState(!1),i=e.activity.filter(l=>!bD.test(l.text)),a=n?s?e.activity:i:i.slice(0,4);return!a.length&&!(n&&e.activity.length)?null:t.jsxs(t.Fragment,{children:[!n&&t.jsx("div",{className:"lbl",children:"Latest activity"}),t.jsx("div",{className:"feed",children:a.map((l,c)=>t.jsxs("div",{className:"fe",children:[t.jsx("span",{className:"tm",children:tn(l.at)}),t.jsx(Ni,{role:l.who,small:!0}),t.jsx(R,{lead:t.jsx("b",{children:Zs[l.who]}),text:l.text.charAt(0).toLowerCase()+l.text.slice(1)})]},l.at+c))}),n&&i.length<e.activity.length&&t.jsx("button",{className:"btn sm ghost",onClick:()=>r(l=>!l),children:s?"Show only what matters":"Show every step"})]})}const Sm="Decide yourself: take the simplest choice that fits the plan, and say what you chose";function wD({t:e}){const n=re(),s=e.agentQuestion,[r,i,a]=$e(e.id,"agent-pick",null),[l,c,u]=$e(e.id,"agent-own","");if(!s)return t.jsx(_f,{t:e});if(s.port)return t.jsx(cD,{t:e});if(s.kind)return t.jsx(iM,{t:e,extra:t.jsxs(t.Fragment,{children:[t.jsx(_a,{t:e}),t.jsx(Or,{t:e})]})});const h={architect:"Architect",builder:"Builder",reviewer:"Reviewer"}[s.from],m=r===""?l.trim():r,p=[...s.options,Sm];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"db",children:[t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:"?"}),t.jsxs("div",{children:[t.jsxs("b",{children:["The ",h," has a question"]}),t.jsx("span",{children:"It stopped instead of guessing. Your answer goes back into the same conversation, and the work carries on."})]})]}),t.jsxs("div",{className:"lbl",children:[h," asks"]}),t.jsx(R,{as:"p",className:"stuckq",text:s.text}),s.why&&t.jsx(R,{as:"p",className:"note",style:{marginTop:-4},lead:"Why it matters:",text:s.why}),s.files&&s.files.length>0&&t.jsx(uw,{ticket:e.id,files:s.files}),t.jsxs("div",{className:"opts2",children:[p.map(x=>t.jsxs("button",{className:`opt2 ${r===x?"pick":""}`,...ze(x),onClick:()=>i(x),children:[t.jsxs("b",{children:[t.jsx(R,{text:x===Sm?"Let it decide":x}),r===x&&t.jsxs("span",{children:[t.jsx(ce,{size:13,strokeWidth:2.5})," Your pick"]})]}),x===Sm?"It takes the simplest choice that fits the plan and tells you which.":""]},x)),t.jsx("button",{className:`opt2 ${r===""?"pick":""}`,onClick:()=>i(""),children:t.jsx("b",{children:"Write my own answer"})})]}),r===""&&t.jsx("textarea",{className:"input",rows:3,style:{width:"100%",marginTop:8},autoFocus:!0,dir:je(l),value:l,placeholder:"Your answer",onChange:x=>c(x.target.value)}),t.jsx(Or,{t:e})]}),t.jsxs("div",{className:"df",children:[t.jsxs("button",{className:"btn pri",disabled:!m||n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/reply`,body:{text:m},done:`Sent. The ${h} carries on.`},{onSuccess:()=>{a(),u()}}),children:[t.jsx(qs,{size:15})," Send answer"]}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad reply ${e.id}${m?` ${Me(m.length>40?`${m.slice(0,40)}…`:m)}`:""}`})]})]})}const ND=(e,n)=>e?new Date(e).toLocaleDateString(n==="ar"?"ar-u-nu-latn":"en-GB",{day:"numeric",month:"short"}):"",Ug=(e,n)=>e.pr===void 0||e.pr===n.pr?.id,P5=e=>e.contribution;function SD(e){const n=P5(e);return!n||!e.pr||n.state==="fixing"?!1:!e.waiting||e.stuck?.kind==="owner-notes"||e.stuck?.kind==="owner-closed"}function CD(e,n,s){const r=Ri[s],i=n.track;switch(e.id){case"looks-right":return r.step["looks-right"]();case"pushed":return r.step.pushed(i?.copy,i?.branch);case"opened":return r.step.opened(n.into);case"review":return e.state==="closed"?{title:r.closedTitle,sub:r.reviewSub.closed}:{title:r.step.review,sub:e.state==="now"?r.reviewSub[n.state]:""};default:return{title:r.step.merged}}}function Sk({v:e,lang:n}){const s=Ri[n],r=e.track?.host??"";return t.jsxs("div",{className:"pr-panel",children:[t.jsxs("h3",{children:[t.jsx(mu,{size:16,"aria-hidden":"true"}),s.head," ",t.jsxs("span",{className:"mono",children:["#",e.pr?.id]}),e.pr&&t.jsxs("a",{href:e.pr.url,target:"_blank",rel:"noreferrer",children:[t.jsx(Xt,{size:14})," ",s.open(r)]})]}),t.jsx("ol",{className:"pr-track",children:(e.track?.steps??[]).map(i=>{const a=CD(i,e,n);return t.jsxs("li",{className:i.state==="done"?"":i.state,children:[t.jsxs("span",{className:"pr-dot","aria-hidden":"true",children:[i.state==="done"&&t.jsx(ce,{size:12,strokeWidth:2.8}),i.state==="closed"&&t.jsx(Ue,{size:12,strokeWidth:2.8})]}),t.jsxs("div",{children:[a.title,a.sub&&t.jsx("small",{children:a.sub})]}),t.jsx("span",{className:"t",children:i.at?tn(i.at):""})]},i.id)})}),t.jsx("p",{className:"pr-note",children:s.note})]})}function R5({n:e,lang:n,fixed:s}){const r=Ri[n];return t.jsxs("div",{className:"pr-cmt",children:[t.jsx("span",{className:"av","aria-hidden":"true",dir:"ltr",children:e.who.slice(0,2).toUpperCase()}),t.jsxs("div",{children:[t.jsxs("small",{children:[t.jsx("b",{dir:"ltr",children:e.who}),e.file&&t.jsxs(t.Fragment,{children:[" · ",t.jsx("a",{className:"file",href:e.url,target:"_blank",rel:"noreferrer",dir:"ltr",children:e.file})]}),e.line?` · ${r.line(e.line)}`:""]}),t.jsx("p",{dir:"auto",children:e.text}),s&&e.fixedIn&&t.jsxs("span",{className:"pr-fixed",children:[t.jsx(ce,{size:12,strokeWidth:2.8,"aria-hidden":"true"}),r.fixedIn," ",t.jsx("code",{children:e.fixedIn})]})]})]})}function $D({t:e,v:n,lang:s}){const r=Ri[s],i=re(),a=n.track?.host??"",l=n.notes.filter(m=>m.state==="new"&&Ug(m,n)),c=n.actions.find(m=>m.id==="fix"),u=n.actions.find(m=>m.id==="leave"),h=l.map(m=>`> ${[m.file,m.line?`line ${m.line}`:""].filter(Boolean).join(" ")||m.who}: ${m.text.replace(/\s+/g," ")}`).join(`
732
+ `);return t.jsxs("div",{className:"pr-card",children:[t.jsxs("div",{className:"ch",children:[t.jsxs("span",{className:"mono",children:["#",n.pr?.id]}),r.notesHead,t.jsx("em",{children:r.notesTag})]}),t.jsx("div",{className:"cb",children:l.map(m=>t.jsx(R5,{n:m,lang:s},m.id))}),t.jsxs("div",{className:"cf",children:[t.jsxs("div",{className:"pr-row",children:[c&&t.jsx("button",{className:"btn pri",disabled:i.isPending,onClick:()=>i.mutate({path:`/api/v1/tickets/${e.id}/pull-request/fix`,done:"The Builder fixes the owner’s notes"}),children:r.fix}),l[0]&&t.jsxs("a",{className:"btn",href:l[0].url,target:"_blank",rel:"noreferrer",children:[t.jsx(Xt,{size:14})," ",r.reply(a)]}),t.jsx(Ng,{label:r.ask,text:r.askText(e.id,h),context:{from:"problem",problem:"waiting",story:e.id}})]}),c&&t.jsx(X,{text:c.command,always:!0}),t.jsx("span",{className:"pr-small",children:r.fixNote}),u&&t.jsxs("span",{className:"pr-small",children:[t.jsx("button",{className:"btn quiet sm",disabled:i.isPending,onClick:()=>i.mutate({path:`/api/v1/tickets/${e.id}/pull-request/leave`,done:r.leaveNote}),children:r.leave(a)})," ",r.leaveNote,t.jsx(X,{text:u.command})]})]})]})}function TD({v:e,lang:n}){const s=Ri[n],r=e.notes.filter(i=>i.state==="fixed"&&Ug(i,e));return t.jsxs("div",{className:"pr-card done",children:[t.jsxs("div",{className:"ch",children:[t.jsxs("span",{className:"mono",children:["#",e.pr?.id]}),s.fixedHead,t.jsx("em",{children:s.fixedTag})]}),t.jsx("div",{className:"cb",children:r.map(i=>t.jsx(R5,{n:i,lang:n,fixed:!0},i.id))}),t.jsx("div",{className:"cf",children:t.jsx("span",{className:"pr-small",children:r.every(i=>i.answered)?s.pushed:s.pushedSome})})]})}function ED({t:e,v:n,lang:s}){const r=Ri[s],i=re(),a=n.actions.find(l=>l.id==="check");return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"pr-box wait",children:[t.jsx("span",{className:"big","aria-hidden":"true",children:t.jsx(pu,{size:17})}),t.jsxs("div",{children:[t.jsx("b",{children:r.step.review}),t.jsx("small",{children:r.reviewSub.waiting})]})]}),a&&t.jsxs("div",{className:"pr-row",children:[t.jsx("button",{className:"btn sm",disabled:i.isPending,onClick:()=>i.mutate({path:`/api/v1/tickets/${e.id}/check-merge`,done:l=>l.line??null}),children:r.check}),t.jsx(X,{text:a.command})]}),t.jsx("span",{className:"pr-small",children:n.lookedAt?r.looked(tn(n.lookedAt)):r.notLooked})]})}function AD({v:e,lang:n}){const s=Ri[n],r=e.track?.steps.find(i=>i.id==="merged")?.at??e.since??"";return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"pr-box",children:[t.jsx("span",{className:"big","aria-hidden":"true",children:t.jsx(pu,{size:17})}),t.jsxs("div",{children:[t.jsx("b",{children:s.mergedHead}),t.jsx("small",{children:s.mergedSub(e.into??"",e.pr?.id??0,ND(r,n),r?tn(r):"")})]})]}),t.jsx("p",{className:"pr-small",dir:"auto",children:e.track?.catchUp??s.syncLater})]})}function PD({t:e}){const n=Br(),s=P5(e),r=`${e.status}|${e.mergedAt??""}|${e.stuck?.kind??""}|${e.activity.length}|${s?.state??""}|${s?.lookedAt??""}`,i=ve({queryKey:["pull-request",e.id,r],queryFn:()=>ye(`/api/v1/tickets/${e.id}/pull-request`),refetchInterval:3e4}),a=i.data;if(!a)return i.isError?t.jsx(ys,{what:"the pull request",error:i.error,onRetry:()=>void i.refetch()}):t.jsx("div",{className:"db center",children:t.jsx(Xe,{size:16,className:"spin","aria-label":"Loading the pull request"})});if(a.to!=="owner")return t.jsx("div",{className:"db",children:t.jsx("p",{className:"pr-note",children:a.line})});const l=n==="ar"?"rtl":"ltr";if(a.state==="closed"&&e.stuck)return t.jsx(Z3,{t:e,extra:t.jsx("div",{className:"prw",dir:l,lang:n,children:t.jsx(Sk,{v:a,lang:n})})});const c=a.notes.some(h=>h.state==="fixed"&&Ug(h,a));let u=null;return a.state==="notes"?u=t.jsx($D,{t:e,v:a,lang:n}):a.state==="merged"?u=t.jsx(AD,{v:a,lang:n}):a.state==="waiting"&&(u=t.jsxs(t.Fragment,{children:[c&&t.jsx(TD,{v:a,lang:n}),t.jsx(ED,{t:e,v:a,lang:n})]})),t.jsx("div",{className:"db prw",dir:l,lang:n,children:t.jsxs("div",{className:"pr-grid",children:[t.jsx(Sk,{v:a,lang:n}),t.jsx("div",{className:"pr-side",children:u})]})})}function RD({t:e}){if(SD(e))return t.jsx(PD,{t:e});if(!e.waiting&&e.quiet)return t.jsx(yD,{t:e});if(P_(e))return t.jsx(q_,{t:e});switch(e.waiting?.kind){case"questions":return t.jsx(W_,{t:e});case"spec":case"plan":return t.jsx(Q_,{t:e});case"proof":return e.now?.merging?t.jsx(xD,{t:e}):t.jsx(lD,{t:e});case"stuck":return t.jsx(Z3,{t:e,extra:t.jsxs(t.Fragment,{children:[t.jsx(_a,{t:e}),e.stuck?.gate==="proof"&&e.proof?.some(n=>n.after)&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:q1(e,"What the screenshots show")}),t.jsx(Wg,{t:e})]}),xi(e)&&t.jsx(su,{t:e}),e.stuck?.gate==="merge"&&e.clashedPr&&t.jsx(Dg,{t:e,text:`Settled the clash and merged pull request ${e.clashedPr.id} on the code host yourself? squad-kit looks by itself every few minutes, or now:`}),t.jsx(Or,{t:e})]})});case"ask":return t.jsx(wD,{t:e});case"split":return t.jsx("div",{className:"db",children:t.jsx(L1,{t:e})});case"yours":return e.takenOver?.free?t.jsx(GL,{t:e,extra:t.jsx(Or,{t:e})}):t.jsx(kD,{t:e});case"chat":return e.chat?t.jsx(qD,{t:e}):t.jsx(_f,{t:e});default:return t.jsx(_f,{t:e})}}function qD({t:e}){const n=ct[e.chat.with];return t.jsx("div",{className:"db",children:t.jsxs("div",{className:"youbox",children:[t.jsx("span",{className:"ring",children:t.jsx(Xn,{size:15})}),t.jsxs("div",{children:[t.jsxs("b",{children:["Talking it through with the ",n]}),t.jsx("span",{children:"The talk is open in its popup, at the bottom right. Its work waits until you press a button there."})]}),t.jsx("span",{className:"grow"}),t.jsx(ge,{to:"/conversations",search:{ticket:e.id},className:"btn sm",children:"Full screen"})]})})}function ID({t:e}){const n=re(),[s,r]=N.useState(null),[i,a,l]=$e(e.id,"keep-reason",""),c=!!e.mergedAt||e.stage==="done";return t.jsx("div",{className:"outdated",children:e.outdated.map(u=>t.jsxs("div",{className:"outdated-item",children:[t.jsxs("div",{className:"outdated-head",children:[t.jsx("span",{className:"ic",children:t.jsx(Is,{size:15})}),t.jsxs("b",{children:[t.jsx(ge,{to:"/architecture",search:{adr:u.adr},children:u.adr})," came after this plan and changes it"]})]}),t.jsx(R,{as:"p",text:u.why}),t.jsx(R,{as:"p",lead:t.jsx("span",{className:"note",children:c?"What a follow-up would change:":"What would change:"}),text:u.change}),s===u.adr?t.jsxs("div",{className:"row",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:je(i),value:i,onChange:h=>a(h.target.value),placeholder:"Why the plan stays as it is"}),t.jsx("button",{className:"btn sm",disabled:!i.trim()||n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/decision-update`,body:{adr:u.adr,do:"keep",reason:i},done:"Kept the plan. The reason is on the ticket."},{onSuccess:()=>{r(null),l()}}),children:"Keep it"}),t.jsx("button",{className:"btn sm quiet",onClick:()=>r(null),children:"Cancel"})]}):t.jsxs("div",{className:"row",children:[t.jsx("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/tickets/${e.id}/decision-update`,body:{adr:u.adr,do:"update"},done:c?"Made a follow-up ticket.":"The Architect is updating the plan."}),children:c?"Make a follow-up ticket":"Update the plan"}),t.jsx("button",{className:"btn sm",onClick:()=>{r(u.adr),a("")},children:"Keep it as is"})]})]},u.adr))})}function FD({t:e}){return t.jsxs("div",{className:"db",children:[t.jsx("div",{className:"lbl",children:"What was asked"}),t.jsx(f1,{as:"p",className:"story",style:{whiteSpace:"pre-wrap"},text:e.ask}),t.jsx($m,{head:"Your acceptance criteria",items:e.brief?.criteria}),t.jsx($m,{head:"Business rules",items:e.brief?.rules}),t.jsx($m,{head:"Edge cases",items:e.brief?.edgeCases}),t.jsx(zD,{t:e}),t.jsx(LD,{t:e}),t.jsx(IT,{t:e}),t.jsx(fg,{t:e}),e.story?t.jsx(ru,{t:{...e,decision:void 0,work:void 0}}):t.jsx("p",{className:"note",style:{marginTop:16},children:"The Analyst writes the user story after your answers."})]})}const Cm=[{kind:"note",label:"Note",head:"Note",hint:"Anything the squad should know"},{kind:"rule",label:"Business rule",head:"Rule",hint:"For example: at most 3 bookings a day per person"},{kind:"criterion",label:"Acceptance criterion",head:"Done when",hint:"The Tester must prove it, for example: the clerk sees an error on the 4th booking"}];function LD({t:e}){const n=re(),[s,r]=N.useState("note"),[i,a]=$e(e.id,"note",""),l=e.notes??[],c=e.stage!=="done",u=Cm.find(m=>m.kind===s),h=()=>{!i.trim()||n.isPending||n.mutate({path:`/api/v1/tickets/${e.id}/notes`,body:{text:i,kind:s},done:e.live?"Added. The squad reads it at its next step.":"Added. Every agent on this ticket reads it."},{onSuccess:()=>a("")})};return!c&&!l.length?null:t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["Notes",l.length?` · ${l.length}`:""]}),l.length>0&&t.jsx("ul",{className:"ticketnotes",children:l.map((m,p)=>t.jsxs("li",{...ze(m.text),children:[t.jsx("span",{className:`pill ${m.kind==="criterion"?"ok":m.kind==="rule"?"wait":""}`,children:Cm.find(x=>x.kind===m.kind)?.head}),t.jsx(R,{className:"grow",text:m.text}),t.jsxs("span",{className:"note",dir:"ltr",children:[t.jsx(R,{text:m.by})," · ",st(m.at)]})]},p))}),c&&t.jsxs("div",{className:"addnote",children:[t.jsx("div",{className:"seg",style:{width:"fit-content"},children:Cm.map(m=>t.jsx("button",{className:s===m.kind?"on":"",onClick:()=>r(m.kind),children:m.label},m.kind))}),t.jsx("textarea",{className:"input",rows:2,dir:je(i),value:i,placeholder:u.hint,onChange:m=>a(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.metaKey||m.ctrlKey)&&i.trim()&&h()}}),t.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[t.jsxs("button",{className:"btn pri sm",disabled:!i.trim()||n.isPending,onClick:h,children:["Add ",u.label.toLowerCase()]}),t.jsxs("span",{className:"note",children:["Every agent on this ticket reads it",e.live?", the one working now from its next step":"","."]}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad note ${e.id}${s==="note"?"":` --${s}`} ${Me(i.trim()||"…")}`})]})]})]})}function $m({head:e,items:n}){return n?.length?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:e}),t.jsx("ul",{className:"brief",children:n.map((s,r)=>t.jsx(R,{as:"li",text:s},r))})]}):null}const Ck=/\.(png|jpe?g|gif|webp|bmp)$/i;function zD({t:e}){const[n,s]=N.useState(null),r=e.attachments??[];if(!r.length)return null;const i=c=>c.split(/[\\/]/).pop()??c,a=r.filter(c=>Ck.test(c)).map(c=>({src:In(e.id,c),caption:i(c)})),l=r.filter(c=>!Ck.test(c));return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lbl",children:["Attached · ",r.length]}),a.length>0&&t.jsx("div",{className:"thumbs",children:a.map((c,u)=>t.jsx("button",{className:"zoom thumb",onClick:()=>s(u),"aria-label":`Open ${c.caption} full size`,children:t.jsx("img",{src:c.src,alt:c.caption,loading:"lazy"})},c.src))}),l.map(c=>t.jsx("a",{className:"filechip mono",href:In(e.id,c),target:"_blank",rel:"noreferrer",children:i(c)},c)),n!==null&&t.jsx(zs,{pictures:a,start:n,onClose:()=>s(null)})]})}function MD({t:e}){return e.story?t.jsxs("div",{className:"db",children:[t.jsx(ru,{t:e}),e.steps&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Steps"}),t.jsx(A5,{t:e})]})]}):t.jsx("div",{className:"db",children:t.jsx("p",{className:"note",children:"The plan is written after the questions are answered."})})}function OD({t:e}){return t.jsx("div",{className:"db",children:t.jsx(Or,{t:e,all:!0})})}function _D({t:e}){return e.gates?t.jsxs("div",{className:"db",children:[t.jsx("div",{className:"lbl",children:"Gates, checked by squad-kit"}),t.jsx(Bg,{t:e}),t.jsx(_a,{t:e}),t.jsx("div",{className:"lbl",children:q1(e,"Before and after")}),e.gates.proof==="pass"||e.proof?.some(n=>n.shows)?t.jsx(Wg,{t:e}):t.jsx("p",{className:"note",children:"The screens are recorded after all checks pass."})]}):t.jsx("div",{className:"db",children:t.jsx("p",{className:"note",children:"The Tester records the proof after the Builder finishes."})})}function DD({t:e}){const n=N.useMemo(()=>{const s=new Set,r=[...e.activity.map(i=>i.text),...(e.steps??[]).map(i=>i.live??"")];for(const i of r)for(const a of i.matchAll(/[\w./-]+\/[\w.-]+\.\w+/g))s.add(a[0]);return[...s]},[e]);return t.jsxs("div",{className:"db",children:[t.jsx(yz,{t:e}),t.jsx("div",{className:"lbl",children:"Branch"}),t.jsxs("p",{className:"mono",style:{fontSize:13},children:[e.repo?`${e.repo}: `:"",e.branch??`squad/${e.id.toLowerCase()}`]}),e.worktree&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The ticket's copy of the code"}),t.jsx("p",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:e.storyDir??e.worktree}),t.jsx(Fu,{t:e})]}),e.gates?.ran?.length?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"The checks that ran"}),t.jsx("div",{className:"feed",children:e.gates.ran.map(s=>t.jsxs("div",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:[s.name,": ",s.command," (",s.failedOnce?"failed once, passed when run again":s.ok?"passed":"failed",")"]},s.name))})]}):null,e.testChange||e.testDecided?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"How the tests run"}),t.jsxs("div",{className:"feed",children:[e.testDecided&&t.jsxs("div",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:[e.testDecided.kept==="new"?`Kept the new one: ${e.testDecided.to} (was ${e.testDecided.from})`:`Kept the current one: ${e.testDecided.from} (not ${e.testDecided.to})`,", by ",e.testDecided.by==="you"?"you":"squad-kit",e.testDecided.ran?`. ${e.testDecided.ran}`:""]}),e.testChange&&t.jsxs("div",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:[e.testChange.ask?"Waiting for a choice":"Tried at the next checks",": ",e.testChange.from," or ",e.testChange.to,e.testChange.ran?`. ${e.testChange.ran}`:""]})]})]}):null,e.localSetup&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Setting up your own copy"}),t.jsxs("p",{className:"mono",style:{fontSize:12.5,overflowWrap:"anywhere"},children:[e.localSetup.command," in ",e.localSetup.dir," (",e.localSetup.status,")"]})]}),t.jsx("div",{className:"lbl",children:"Files the squad touched"}),n.length?t.jsx("div",{className:"feed",children:n.map(s=>t.jsx("div",{className:"mono",style:{fontSize:12.5},children:s},s))}):t.jsx("p",{className:"note",children:"No files changed yet."}),t.jsx("div",{className:"lbl",children:"In the terminal"}),t.jsxs("div",{className:"pills",children:[t.jsx(X,{text:`squad show ${e.id}`}),t.jsx(X,{text:`squad watch ${e.id}`})]})]})}function q5({id:e,tab:n,onClose:s}){const r=qa(e),i=Ei(),{ticketFull:a,toggleTicketFull:l}=Le(),[c,u]=N.useState(null),[h,m]=N.useState(n??"now");N.useEffect(()=>m(n??"now"),[e,n]),N.useEffect(()=>{const b=w=>w.key==="Escape"&&!document.querySelector(".modal")&&s();return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[s]);const p=r.data,x=De(),g=x.data?.ready?x.data.meta.parts:void 0,j=x.data?.ready?x.data.meta.engine==="live":!1,k=p?.parts?.length?p.parts.map(b=>g?.find(w=>w.id===b)?.name??b):Lb(g,p?.repo);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"veil",onClick:s}),t.jsx("aside",{className:`drawer ${a?"full":""}`,"aria-label":p?`${p.id} ${p.title}`:"Ticket",children:p?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"dh",children:[t.jsxs("div",{className:"dtop",children:[t.jsx("span",{className:"idtag",children:p.id}),p.source.type!=="manual"&&(p.source.url?t.jsxs("a",{className:"src",href:p.source.url,target:"_blank",rel:"noreferrer",children:[t.jsx(gs,{size:14})," ",p.source.itemType??"Item"," ",p.source.ref," ",t.jsx(Xt,{size:12})]}):t.jsxs("span",{className:"src",children:[t.jsx(gs,{size:14})," From ",p.source.ref]})),p.pr&&t.jsxs("a",{className:"src",href:p.pr.url,target:"_blank",rel:"noreferrer",children:[t.jsx(mu,{size:14})," Pull request ",p.pr.id," ",t.jsx(Xt,{size:12})]}),p.kind==="bug"&&t.jsxs("span",{className:"prio",children:["Bug",p.foundIn?` found in ${p.foundIn}`:""]}),p.priority==="high"&&p.kind!=="bug"&&t.jsx("span",{className:"prio",children:"High priority"}),t.jsx(ZL,{t:p}),t.jsx(Lg,{t:p}),t.jsx("span",{className:"grow"}),t.jsxs("span",{className:"dacts",children:[t.jsx(k5,{t:p}),p.waiting?.kind==="proof"&&t.jsx(ge,{to:"/tickets/$id/proof",params:{id:p.id},className:"iconbtn","aria-label":"Open the proof page",children:t.jsx(Xt,{size:15})}),t.jsx("button",{className:"iconbtn",onClick:()=>Cl.open({ticket:p.id}),"aria-label":"Report a problem",title:"Report a problem",children:t.jsx(l1,{size:15})}),t.jsx(S_,{t:p,onDeleted:s,items:[...(ln(p,i)||!i)&&$u(p)&&!p.takenOver?.free?[{key:"propose",label:t.jsxs(t.Fragment,{children:[t.jsx(Ps,{size:15})," ",tr(p)?"Ask for a change…":"Propose a change…"]}),onPick:()=>u("propose")}]:[],...KL(p,i,j)?[{key:"outside",label:t.jsxs(t.Fragment,{children:[t.jsx(ya,{size:15})," Work in another AI tool…"]}),onPick:()=>u("outside")}]:[],...L$(p,i)?[{key:"hand-over",label:t.jsxs(t.Fragment,{children:[t.jsx(Rd,{size:15})," Hand over…"]}),onPick:()=>u("hand-over")}]:[]]}),t.jsx("button",{className:"iconbtn fullbtn",onClick:l,"aria-pressed":a,"aria-label":a?"Back to the side panel":"Full width",title:a?"Back to the side panel":"Full width",children:a?t.jsx(sb,{size:15}):t.jsx(el,{size:15})}),t.jsx("button",{className:"iconbtn",onClick:s,"aria-label":"Close",children:t.jsx(Ue,{size:16})})]})]}),c==="hand-over"&&t.jsx(z$,{t:p,onClose:()=>u(null)}),c==="outside"&&t.jsx(VL,{t:p,onClose:()=>u(null)}),c==="propose"&&t.jsx(Rl,{t:p,onClose:()=>u(null)}),t.jsx(R,{as:"h2",text:p.title}),t.jsx(nM,{t:p}),t.jsxs("div",{className:"sub",children:[t.jsxs("span",{children:["Created by ",t.jsx(R,{as:"b",text:p.createdBy})," ",st(p.createdAt)," · ",t.jsx(tM,{t:p})]}),t.jsxs("span",{children:["Owner ",t.jsx(R,{as:"b",text:Lr(p)}),ln(p,i)?" (you)":""]}),k.length>0&&t.jsxs("span",{children:[k.length>1?"Parts":"Part"," ",t.jsx(R,{as:"b",text:k.join(", ")})]}),p.builder&&t.jsxs("span",{children:["Builder ",t.jsx("b",{children:p.builder})]}),p.reviewer&&t.jsxs("span",{children:["Reviewer ",t.jsx("b",{children:p.reviewer})]})]}),t.jsx(MS,{ticket:p})]}),t.jsxs("div",{className:"tabs",role:"tablist",children:[[["now","Now"],["story","Story"],["plan","Plan"],["activity","Activity"],["conversation","Conversation"],["proof","Proof"],["changes","Changes"],["cost","Cost"]].map(([b,w])=>t.jsxs("button",{className:h===b?"on":"",onClick:()=>m(b),children:[w,b==="now"&&(p.waiting||p.outdated?.length||Xs(p)||Rs(p))&&t.jsx("span",{className:"dot"})]},b)),t.jsxs("button",{className:`dev ${h==="developer"?"on":""}`,onClick:()=>m("developer"),children:[t.jsx(bl,{size:15})," Developer"]})]}),h==="now"&&p.outdated?.length?t.jsx(ID,{t:p}):null,h==="now"&&Rs(p)&&p.waiting?.kind!=="plan"&&(ln(p,i)||!i)?t.jsx(d5,{t:p,banner:!0}):null,h==="now"&&t.jsx(M$,{t:p}),h==="now"&&t.jsx($_,{t:p,onDeleted:s}),h==="now"&&(ln(p,i)||!i)&&t.jsx(PT,{t:p}),h==="now"&&(ln(p,i)||!i)&&p.waiting&&p.waiting.kind!=="stuck"&&p.waiting.kind!=="chat"&&!p.now?.merging&&t.jsx(EM,{t:p}),h==="now"&&(ln(p,i)||!i?t.jsx(RD,{t:p},p.id):t.jsx(O$,{t:p})),h==="story"&&t.jsx(FD,{t:p}),h==="plan"&&t.jsx(MD,{t:p}),h==="activity"&&t.jsx(OD,{t:p}),h==="conversation"&&t.jsx(a_,{t:p,onTab:m}),h==="proof"&&t.jsx(_D,{t:p}),h==="changes"&&t.jsx(uz,{t:p}),h==="cost"&&t.jsx("div",{className:"db",children:t.jsx(aO,{t:p})}),h==="developer"&&t.jsx(DD,{t:p})]}):t.jsx("div",{className:"center",children:r.isError?t.jsxs("div",{children:[t.jsx("p",{children:WS(r.error,e)}),t.jsx("button",{className:"btn",onClick:s,children:"Close"})]}):"Loading…"})})]})}const BD=[{stage:"tickets",role:"analyst",who:"Analyst"},{stage:"specs",role:"architect",who:"Architect"},{stage:"implement",role:"builder",who:"Builder"},{stage:"test",role:"tester",who:"Tester"},{stage:"review",role:"reviewer",who:"Reviewer"},{stage:"release",role:"release",who:"Release"},{stage:"bugs",role:"triage",who:"Triage"}];function WD(){const e=De(),n=PO(),s=_r({from:"/board"}),r=_t({from:"/board"}),[i,a]=N.useState(null),[l,c]=N.useState(""),[u,h]=N.useState(!1),m=ve({queryKey:["ticket-draft-current"],queryFn:()=>ye("/api/v1/tickets/draft/current"),enabled:i!=="new",refetchInterval:S=>S.state.data?.draft?.status==="working"?2e3:3e4}),p={working:"drafting…",done:"draft ready",failed:"draft stopped",cancelled:""}[m.data?.draft?.status??"cancelled"];N.useEffect(()=>{s.write&&(a("new"),r({search:S=>({...S,write:void 0}),replace:!0}))},[s.write,r]);const x=s.view??"all",g=S=>void r({search:T=>({...T,ticket:S,tab:void 0})}),j=()=>void r({search:S=>({...S,ticket:void 0,tab:void 0})}),k=e.data?.ready?e.data:null,b=N.useMemo(()=>{const S=[...k?.tickets??[],...u?k?.archived??[]:[]],T=l.trim().toLowerCase();return S.filter(E=>x==="bugs"&&E.kind!=="bug"||x==="mine"&&!ln(E,k?.meta.user?.name)?!1:!T||E.title.toLowerCase().includes(T)||E.id.toLowerCase().includes(T))},[k,l,x,u]);if(e.isLoading)return t.jsx("div",{className:"center",children:"Loading the board…"});if(e.isError&&!e.data)return t.jsx(ys,{what:"the board",error:e.error,onRetry:()=>void e.refetch()});if(!k)return t.jsx(KD,{settings:e.data?.settings});const w=k.tickets.filter(ju);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Board"}),t.jsx("div",{className:"seg",role:"tablist",children:["all","mine","bugs"].map(S=>t.jsx("button",{className:x===S?"on":"",onClick:()=>void r({search:T=>({...T,view:S==="all"?void 0:S})}),children:S==="all"?"All tickets":S==="mine"?"Mine":"Bugs"},S))}),t.jsx("span",{className:"grow"}),t.jsxs("label",{className:"search",children:[t.jsx(wi,{size:15}),t.jsx("input",{dir:je(l),value:l,onChange:S=>c(S.target.value),placeholder:"Search tickets","aria-label":"Search tickets"})]}),t.jsx(HD,{onPull:()=>a("pull")}),t.jsxs("button",{className:"btn pri",onClick:()=>a("new"),children:[t.jsx(jt,{size:15})," New ticket",p&&t.jsx("span",{className:"btn-tag",children:p})]})]}),(n||w.length===0)&&t.jsxs("section",{className:"waiting","aria-label":"Waiting for you",children:[t.jsxs("div",{className:"wh",children:[t.jsx("h2",{children:"Waiting for you"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:"squad inbox"})]}),n?t.jsx(X4,{}):k.meta.engine==="live"&&k.tickets.length===0?t.jsxs("div",{className:"calmlane",children:[t.jsx("span",{className:"glyph",children:t.jsx(jt,{size:14,strokeWidth:2.5})}),t.jsxs("span",{children:[t.jsx("b",{children:"Start with your first ticket."})," Write what you want in plain words. The squad asks what it needs to know."]}),t.jsx("span",{className:"grow",style:{flex:1}}),t.jsxs("button",{className:"btn pri sm",onClick:()=>a("new"),children:[t.jsx(jt,{size:14})," New ticket"]})]}):t.jsxs("div",{className:"calmlane",children:[t.jsx("span",{className:"glyph",children:t.jsx(ce,{size:14,strokeWidth:2.5})}),t.jsxs("span",{children:[t.jsx("b",{children:"Nothing needs you right now."})," The squad is working. New questions and approvals show up at the top of every page."]})]})]}),(k.broken?.length??0)>0&&t.jsx(ml,{list:k.broken}),(k.brokenRecords?.length??0)>0&&t.jsx(ml,{list:k.brokenRecords,label:"Files that could not be read"}),t.jsx(lC,{tickets:k.tickets,archived:k.archived??[],live:k.meta.engine==="live",project:k.meta.project,onOpen:g}),t.jsx("div",{className:"board",children:BD.map(S=>{const T=b.filter(E=>E.stage===S.stage);return t.jsxs("section",{className:"lane","aria-label":er[S.stage],children:[t.jsxs("div",{className:"lh",children:[t.jsx(Ni,{role:S.role}),t.jsxs("span",{className:"t",children:[t.jsx("b",{children:er[S.stage]}),t.jsx("small",{children:S.who})]}),t.jsx("span",{className:"n",children:T.length})]}),T.map(E=>t.jsx(UD,{t:E,selected:s.ticket===E.id,onOpen:()=>g(E.id)},E.id)),T.length===0&&t.jsx("div",{className:"empty-lane",children:"Nothing here"})]},S.stage)})}),t.jsxs("div",{className:"foot",children:[t.jsxs("span",{children:["Last 30 days ",t.jsxs("b",{children:[k.stats.released30," tickets released"]})]}),t.jsxs("span",{children:[t.jsx("b",{children:k.stats.bugs30})," ",k.stats.bugs30===1?"bug":"bugs"," found after release"]}),t.jsxs("span",{children:[t.jsx("b",{children:k.stats.open})," open tickets"]}),t.jsx(rO,{}),t.jsx("span",{className:"grow"}),(k.archived?.length??0)>0&&t.jsx("button",{className:"btn sm quiet",title:"squad board --archived",onClick:()=>h(!u),children:u?"Hide archived":`Show archived (${k.archived.length})`}),t.jsx("button",{className:"btn sm quiet",onClick:()=>a("bug"),children:"Report a bug"})]}),s.ticket&&t.jsx(q5,{id:s.ticket,...s.tab?{tab:s.tab}:{},onClose:j}),i==="new"&&t.jsx(X3,{onClose:()=>a(null),onCreated:S=>g(S.id)}),i==="pull"&&t.jsx(Tz,{onClose:()=>a(null),onCreated:S=>g(S.id)}),i==="bug"&&t.jsx(hg,{onClose:()=>a(null)})]})}function UD({t:e,selected:n,onOpen:s}){const r=!!e.now?.merging,i=!r&&(!!e.waiting||e.quiet?.kind==="stuck"||Xs(e)||Rs(e)),a=Ei();return t.jsxs("button",{className:`card ${i?"you":""} ${e.kind==="bug"?"bug":""} ${n?"sel":""}`,onClick:s,children:[t.jsxs("div",{className:"row1",children:[t.jsx("span",{className:"id",children:e.id}),e.track==="express"&&t.jsx("span",{className:"prio express",children:"Express"}),t.jsx(sM,{t:e}),i?t.jsx("span",{className:"youtag",children:"You"}):e.kind==="bug"?t.jsx("span",{className:"prio",children:"Bug"}):e.priority==="high"?t.jsx("span",{className:"prio",children:"High"}):null,a&&!ln(e,a)&&t.jsx(R,{className:"prio owner",title:"Their squad works on it",text:Lr(e)}),e.archived&&t.jsx("span",{className:"prio owner",children:"Archived"}),e.gates?.checks==="unchecked"&&t.jsx("span",{className:"prio unchecked",title:Ig,children:"Not checked"}),t.jsx(XL,{t:e}),t.jsx(b_,{t:e}),t.jsx(z_,{t:e})]}),t.jsx(R,{as:"h4",text:e.title}),t.jsx(rM,{t:e}),w5(e)&&!i?t.jsx(uD,{t:e}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"st",children:[(e.live||r)&&!i?t.jsx("span",{className:"live"}):e.stage==="release"?t.jsx(ce,{size:13,strokeWidth:2.5}):null,t.jsx(R,{text:r?e.now.line:e.quiet?e.quiet.kind==="stuck"?`Looks stuck: ${e.quiet.command??"no progress"}`:`Taking long: ${e.quiet.command??e.status}`:e.status})]}),typeof e.progress=="number"&&!i&&t.jsx("div",{className:"bar",children:t.jsx("i",{style:{width:`${e.progress}%`}})})]})]})}function HD({onPull:e}){const s=ve({queryKey:["tracker"],queryFn:()=>ye("/api/v1/tracker"),refetchInterval:6e4}).data;return s?s.type==="none"?t.jsxs(ge,{to:"/settings",className:"btn",children:[t.jsx(gs,{size:15})," Connect a tracker"]}):t.jsxs("button",{className:"btn",onClick:e,children:[t.jsx(gs,{size:15})," Pull from ",s.label??"the tracker"]}):null}function ml({list:e,label:n="Tickets that could not be read"}){return t.jsx("section",{className:"stuckbox",role:"alert","aria-label":n,style:{marginBottom:14},children:e.map(s=>t.jsxs("div",{children:[t.jsx("p",{children:s.problem}),t.jsxs("details",{children:[t.jsx("summary",{className:"note",children:"For an engineer"}),t.jsx("pre",{className:"mono note",style:{whiteSpace:"pre-wrap"},children:`${s.file}
733
+ ${s.detail}`})]})]},s.id))})}function KD({settings:e}){return e?t.jsx("div",{className:"center",children:t.jsxs("div",{role:"alert",children:[t.jsx("h2",{children:"This board cannot open"}),t.jsx("p",{children:e})]})}):t.jsx("div",{className:"center",children:t.jsxs("div",{children:[t.jsx("h2",{children:"No board yet"}),t.jsx("p",{children:"This project has not been set up yet. Go to Home to set it up, or to try a sample board."}),t.jsxs("p",{style:{marginTop:12},children:[t.jsx("a",{className:"btn",href:"/",children:"Go to Home"})," ",t.jsx(X,{text:"squad demo"})]})]})})}function VD(){const{id:e}=du({from:"/tickets/$id/proof"}),n=qa(e),[s,r]=N.useState(0),[i,a]=N.useState(null),l=n.data;if(!l)return t.jsx("div",{className:"center",children:n.isError?`No ticket ${e}.`:"Loading…"});const c=l.proof??[],u=c[Math.min(s,c.length-1)],h=l.waiting?.kind==="proof"&&!l.now?.merging,m=l.gates,{pictures:p,starts:x}=b1(c,j=>Mt(`/api/v1/proof/${j}`)),g=x[Math.min(s,c.length-1)]??0;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsxs("span",{className:"crumbs",children:[t.jsx(ge,{to:"/inbox",children:"Waiting for you"})," /",t.jsx(ge,{to:"/board",search:{ticket:l.id},children:t.jsx(R,{lead:l.id,text:l.title})})," ","/ ",t.jsx("b",{children:"Proof"})]}),t.jsx("span",{className:"grow"}),t.jsx(k5,{t:l})]}),t.jsxs("div",{className:`gatebar ${m?.checks==="unchecked"?"unchecked":""}`,children:[t.jsx(us,{state:m?.checks,text:u5(m)}),t.jsx(us,{state:m?.review,text:m?.review==="skipped"?"Review notes open, you continued":`Review approved${m?.reviewBy?` by ${m.reviewBy}`:""}`}),t.jsx(us,{state:m?.proof,text:p5(l)}),t.jsx(Lg,{t:l}),t.jsx("span",{style:{marginLeft:6},children:"Nothing ships without these three."})]}),t.jsx(g5,{g:m,className:"gatebar-why"}),t.jsx(f5,{g:m,className:"gatebar-why"}),t.jsx(_a,{t:l,className:"gatebar-why"}),ol(l)?t.jsxs("div",{className:"kindpage",children:[t.jsx(v5,{t:l}),xi(l)&&t.jsx(su,{t:l})]}):t.jsxs("div",{className:"split proofsplit",children:[t.jsxs("div",{className:"critlist",children:[t.jsxs("div",{className:"lbl",style:{marginTop:0},children:["Done when · ",c.length]}),c.map((j,k)=>t.jsxs("button",{className:`crit ${k===s?"on":""}`,...ze(j.criterion),onClick:()=>r(k),children:[t.jsx(Mg,{shows:j.shows}),t.jsxs("span",{children:[t.jsx(R,{text:j.criterion}),t.jsx(tu,{shows:j.shows}),Ud(j).length>0&&t.jsx("small",{className:"critpage-s",dir:"ltr",children:Ud(j).join(" · ")})]})]},j.criterion)),c.length===0&&t.jsx("p",{className:"note",children:m5(l)}),t.jsx(nu,{t:l}),xi(l)&&t.jsx(su,{t:l})]}),t.jsx("div",{className:"stage",children:u?t.jsxs(t.Fragment,{children:[t.jsx(R,{as:"h3",text:u.criterion}),u.shows&&t.jsxs("p",{className:`verdictline ${Nu(u.shows)}`,children:[t.jsx(tu,{shows:u.shows}),u.shows!=="met"&&ka(u)&&t.jsx(R,{text:ka(u)})]}),nr(u)&&t.jsxs("p",{className:"critpage",children:["Page ",t.jsx("code",{children:nr(u)})]}),t.jsx(T_,{t:l}),_d(u.after)?t.jsx(Uu,{file:u.after,...u.note?{note:u.note}:{}}):t.jsxs("div",{className:"ba",children:[t.jsxs("div",{className:u.beforeDevice?"ondevice":void 0,children:[t.jsx("div",{className:"cap",children:t.jsx(R,{text:u.beforeLabel})}),t.jsx("button",{className:"zoom",onClick:()=>a(g),"aria-label":`Open ${u.beforeLabel} full size`,children:t.jsx("img",{src:Mt(`/api/v1/proof/${u.before}`),alt:`${u.criterion}, ${u.beforeLabel}`})}),u.beforeDevice&&t.jsx("small",{className:"shotdevice",children:u.beforeDevice})]}),t.jsxs("div",{className:u.device?"ondevice":void 0,children:[t.jsx("div",{className:"cap",children:t.jsx(R,{text:u.afterLabel})}),t.jsx("button",{className:"zoom",onClick:()=>a(g+1),"aria-label":`Open ${u.afterLabel} full size`,children:t.jsx("img",{src:Mt(`/api/v1/proof/${u.after}`),alt:`${u.criterion}, ${u.afterLabel}`})}),u.device&&t.jsx("small",{className:"shotdevice",children:u.device})]})]}),u.note&&!_d(u.after)&&t.jsx(R,{as:"p",className:"note",text:u.note}),t.jsx(Og,{shot:u,first:g+2,onOpen:a})]}):t.jsx("p",{className:"note",children:"Nothing to compare."})})]}),i!==null&&t.jsx(zs,{pictures:p,start:i,onClose:()=>a(null)}),h?t.jsx(b5,{t:l,sticky:!0}):t.jsxs("div",{className:"stickybar",role:l.now?.merging?"status":void 0,children:[l.now?.merging&&t.jsx(Xe,{size:15,className:"spin"}),t.jsx(R,{className:"note",text:l.now?.merging?l.now.line:l.status})]})]})}function Hg({title:e,text:n}){return t.jsxs("div",{className:"ob-card selfnote",role:"note",children:[t.jsx("img",{src:"/logo.svg",alt:"",width:30,height:30}),t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:e}),t.jsx("span",{children:n})]})]})}function YD(){const e=_S(),n=De(),[s,r]=N.useState(null),[i,a]=N.useState(null),l=e.data??[],c=l.find(p=>p.version===s)??l.find(p=>p.status==="draft")??l[0],u=n.data?.ready?n.data.meta.engine==="demo":!1,h=n.data?.brokenRecords?.filter(p=>p.kind==="release")??[],m=n.data?.ready?n.data.self:void 0;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Releases"}),t.jsx("span",{className:"grow"}),!m&&t.jsx(X,{text:"squad release"})]}),h.length>0&&t.jsx(ml,{list:h,label:"Releases that could not be read"}),m&&t.jsx("div",{style:{padding:"0 28px 12px"},children:t.jsx(Hg,{title:"Releases are for squad-kit's maintainers",text:m.releases})}),t.jsxs("div",{className:"split rel",children:[t.jsx("div",{className:"listcol",children:l.map(p=>t.jsxs("button",{className:`litem ${c?.version===p.version?p.status==="draft"?"on":"on plain":""}`,onClick:()=>r(p.version),children:[t.jsxs("b",{children:[p.version,p.status==="draft"?t.jsx("span",{className:"youtag",children:p.items.length?"Ready":"Empty"}):p.bugs?.length?t.jsxs("span",{className:"prio",children:[p.bugs.length," ",p.bugs.length===1?"bug":"bugs"]}):null]}),p.status==="draft"?"Next release":p.unpushed?.length?"Not sent yet":Ls(p.date)," · ",p.items.length," ",p.items.length===1?"ticket":"tickets"]},p.version))}),c?t.jsx(GD,{r:c,onReleased:a,live:!u}):e.isError&&!e.data?t.jsx(ys,{what:"the releases",error:e.error,onRetry:()=>void e.refetch()}):t.jsx("div",{className:"center",children:"No releases yet."})]}),i&&t.jsx(Ez,{release:i,demo:u,onClose:()=>a(null)})]})}function GD({r:e,onReleased:n,live:s}){const r=re(),i=De(),a=$=>(i.data?.ready?i.data.tickets.find(P=>P.id===$)?.title:void 0)??e.titles?.[$]??$,[l,c]=N.useState(!1),[u,h]=N.useState(e.notes),[m,p]=N.useState(!1),x=i.data?.ready?i.data.meta:void 0,g=x?.repos?.length?[...new Set(e.targets.flatMap($=>Lb(x.parts,$.repo)))]:[],[j,k]=N.useState(!1),[b,w]=N.useState(!1);N.useEffect(()=>{l||h(e.notes)},[e.notes,l]);const S=e.status==="draft",T=i.data?.ready?i.data.self:void 0,E=e.unpushed??[],z=e.version.endsWith(".0")?"New features, nothing breaks for users.":"Fixes only, nothing new to learn.";return t.jsxs("div",{className:"detail",children:[t.jsx("h2",{style:{fontSize:24,fontStretch:"88%"},children:S?`Release ${e.version}`:e.version}),t.jsx("p",{className:"note",style:{marginTop:2},children:S&&T?"The stories merged on this computer. The notes help your pull request; the release itself is for the maintainers.":S?"The squad prepared this release. Read it, edit the notes if you like, then release.":`Released ${Ls(e.date)}`}),E.length>0&&t.jsxs("div",{className:"box",style:{marginTop:10,color:"var(--you-ink)"},children:[t.jsx("b",{children:"Not sent yet."})," The release is made on this computer, but it did not reach your team's shared copy of the code, so its tickets stay open.",E.map($=>t.jsxs("div",{style:{marginTop:6},children:[$.plain??"An engineer can see why below.",t.jsxs("details",{style:{marginTop:4},children:[t.jsx("summary",{className:"note",children:"For engineers"}),t.jsxs("div",{className:"mono",style:{fontSize:12.5,marginTop:4},children:[$.repo==="."?"project":$.repo,": ",$.base," → ",$.remote,": ",$.error]})]})]},$.repo)),t.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center",marginTop:10},children:[t.jsxs("button",{className:"btn pri",disabled:r.isPending,onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/push`},{onSuccess:$=>$.unpushed?.length?void 0:n($)}),children:[t.jsx(Fo,{size:15})," Send again"]}),t.jsx("button",{className:"btn quiet",disabled:r.isPending,title:"An engineer brought it in by hand, so Send again cannot see it. You say how; its tickets close.",onClick:()=>w(!0),children:"It reached it another way"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad release ${e.version} --push-again`})]})]}),S&&e.log&&e.log.length>0&&t.jsxs("div",{className:"box",style:{marginTop:10},children:[t.jsx("b",{children:"Last time it did not go out."}),e.log.map($=>t.jsxs("div",{className:"checkrow",style:$.ok?void 0:{color:"var(--you-ink)"},...ze($.text),children:[t.jsx("span",{className:`cbx ${$.ok?"on":""}`,children:$.ok?t.jsx(ce,{size:11,strokeWidth:3}):"!"}),t.jsx(R,{text:$.text})]},$.text))]}),t.jsx("div",{className:"lbl",children:"What's inside"}),e.items.map($=>t.jsxs("div",{className:"trow",children:[t.jsx("span",{className:"mono",children:$.id}),t.jsx(R,{as:"b",text:$.title}),t.jsxs("span",{style:{display:"flex",gap:8,alignItems:"center",justifyContent:"flex-end",flexWrap:"wrap"},children:[$.outside&&t.jsxs("span",{className:`prio outside${$.outside.checked?" checked":""}`,children:[$.outside.from?`Continued outside from ${$.outside.from}`:"Worked outside squad-kit",$.outside.checked?", checked":""]}),t.jsx(Lg,{t:$}),Wu($.gates)?t.jsx(us,{state:"pending",text:"Not checked by squad-kit"}):$.gates?.checks==="unchecked"?t.jsx(us,{state:"unchecked",text:"Not checked · review, proof"}):$.gates&&t.jsxs("span",{className:"pill ok",children:[t.jsx(ce,{size:13,strokeWidth:2.5})," Checks, review, proof"]}),($.gates?.oldFailures?.length??0)>0&&t.jsx("span",{className:"pill unchecked",title:h5($.gates)??void 0,children:Fg($.gates.oldFailures.length)}),S&&e.items.length>1&&t.jsx("button",{className:"btn sm quiet",title:`squad release --without ${$.id}`,disabled:r.isPending,onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/take-out`,body:{ticket:$.id},done:`${$.id} goes out with the next release`}),children:"Take out"})]})]},$.id)),e.items.length===0&&t.jsx("p",{className:"note",children:"No tickets yet. Tickets join after you check their proof."}),S&&e.items.length>1&&t.jsx("div",{style:{marginTop:2},children:t.jsx(X,{text:`squad release --without ${e.items[e.items.length-1].id}`})}),(e.out?.length??0)>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:S?"Taken out of this release":"Left out of this release"}),e.out.map($=>t.jsxs("div",{className:"trow",children:[t.jsx("span",{className:"mono",children:$}),t.jsx(R,{as:"b",text:a($)}),S?t.jsxs("button",{className:"btn sm",disabled:r.isPending,onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/put-back`,body:{ticket:$},done:`${$} is back in ${e.version}`}),children:[t.jsx(ib,{size:13})," Put back"]}):t.jsx("span",{className:"note",children:"Goes out with the next release"})]},$)),S&&t.jsx("p",{className:"note",children:"Its code stays in the project. This release leaves it out, and it goes out with the next one."}),S&&t.jsx("div",{style:{marginTop:6},children:t.jsx(X,{text:`squad release --put-back ${e.out[0]}`})})]}),!S&&e.bugs&&e.bugs.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Bugs found after this release"}),e.bugs.map($=>t.jsxs("div",{className:"trow",children:[t.jsx("span",{className:"mono",children:$}),t.jsx(ge,{to:"/board",search:{ticket:$},children:t.jsx("b",{children:"Open the bug"})}),t.jsx("span",{})]},$))]}),t.jsxs("div",{className:"grid2",children:[t.jsxs("div",{children:[t.jsx("div",{className:"lbl",children:"Version"}),t.jsxs("div",{className:"ver",children:[t.jsx("span",{className:"from",children:e.from.replace(/^v/,"")}),t.jsx(xa,{size:20}),t.jsx("span",{children:e.version.replace(/^v/,"")})]}),t.jsx("p",{className:"note",style:{marginTop:4},children:z}),t.jsx("div",{className:"lbl",children:S||!e.log?"Also":"What the release did"}),!S&&e.log?e.log.map($=>t.jsxs("div",{className:"checkrow",style:$.ok?void 0:{color:"var(--you-ink)"},...ze($.text),children:[t.jsx("span",{className:`cbx ${$.ok?"on":""}`,children:$.ok?t.jsx(ce,{size:11,strokeWidth:3}):"!"}),t.jsx(R,{text:$.text})]},$.text)):[["changelog","Update the changelog"],["tag",`Mark the code as ${e.version}`],["pipeline","Run your after-release step"],["whatsapp","Draft a WhatsApp note for my manager"]].map(([$,P])=>t.jsxs("div",{className:"checkrow",children:[t.jsx("span",{className:`cbx ${e.addons[$]?"on":""}`,children:e.addons[$]&&t.jsx(ce,{size:11,strokeWidth:3})}),P]},$))]}),t.jsxs("div",{children:[t.jsxs("div",{className:"lbl",children:["Release notes",S&&", written by the squad",t.jsx("span",{className:"grow",style:{flex:1}}),S&&!l&&t.jsxs("button",{className:"btn sm",onClick:()=>c(!0),children:[t.jsx(tl,{size:13})," Edit"]})]}),l?t.jsxs(t.Fragment,{children:[t.jsx("textarea",{className:"textarea mono",style:{minHeight:180,fontSize:13},dir:je(u),value:u,onChange:$=>h($.target.value)}),t.jsxs("div",{style:{display:"flex",gap:8,marginTop:8},children:[t.jsx("button",{className:"btn sm pri",onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/notes`,method:"PUT",body:{notes:u},done:"Notes saved"},{onSuccess:()=>c(!1)}),children:"Save notes"}),t.jsx("button",{className:"btn sm",onClick:()=>c(!1),children:"Cancel"})]})]}):t.jsx(OS,{notes:e.notes})]})]}),t.jsx("div",{style:{display:"flex",gap:10,alignItems:"center",marginTop:26},children:S&&T?t.jsx("span",{className:"note",children:"Merged stories wait on main here. Each one says how to send it as a pull request."}):S?t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:e.items.length===0,onClick:()=>p(!0),children:[t.jsx(Fo,{size:15})," Release ",e.version]}),t.jsx("span",{className:"note",children:"You'll be asked once to confirm."})]}):t.jsxs("button",{className:"btn",onClick:()=>k(!0),children:["Report a bug in ",e.version]})}),!!e.gateStop?.length&&t.jsx(XD,{r:e,onReleased:n}),m&&t.jsxs(Ye,{title:`Release ${e.version}?`,onClose:()=>p(!1),icon:t.jsx("span",{className:"glyph",children:t.jsx(Fo,{size:15})}),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:r.isPending,onClick:()=>r.mutate({path:`/api/v1/releases/${e.version}/release`},{onSuccess:$=>{p(!1),n($)}}),children:[t.jsx(Fo,{size:15})," Yes, release it"]}),t.jsx("button",{className:"btn",onClick:()=>p(!1),children:"Not yet"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad release ${e.version}`})]}),children:[t.jsxs("p",{children:[e.items.length," tickets go live:"," ",e.items.map(($,P)=>t.jsxs("span",{children:[P>0&&", ",t.jsx(R,{text:$.title})]},$.id)),"."]}),e.targets.length>0&&t.jsx("div",{className:"box",style:{marginBottom:6},children:g.length>0?t.jsxs("details",{children:[t.jsx("summary",{children:t.jsxs("b",{children:["This release changes ",g.join(", ")]})}),t.jsx("div",{className:"note",style:{marginTop:6},children:"For engineers:"}),t.jsx($k,{r:e})]}):t.jsxs("details",{children:[t.jsx("summary",{children:t.jsx("b",{children:e.targets.some($=>$.remote)?"This release goes to your team's shared copy of the code":"This release stays on this computer: the project has no shared copy"})}),t.jsx("div",{className:"note",style:{marginTop:6},children:"For engineers:"}),t.jsx($k,{r:e})]})})]}),!S&&s&&t.jsx(QD,{}),j&&t.jsx(hg,{foundIn:e.version,onClose:()=>k(!1)}),b&&t.jsx(ZD,{version:e.version,onClose:()=>w(!1),onDone:n})]})}function $k({r:e}){return t.jsxs(t.Fragment,{children:[e.targets.map(n=>t.jsxs("div",{className:"mono",style:{fontSize:12.5,marginTop:6},children:[n.repo==="."?"project":n.repo,": ",n.branch," ",n.remote?`→ pushed to ${n.remote}`:"(no remote, stays on this computer)"]},n.repo)),t.jsx("p",{className:"note",style:{marginTop:6},children:"Change the branch or remote in Settings first if this is not right."})]})}function QD(){const e=re(),s=ve({queryKey:["branches"],queryFn:()=>ye("/api/v1/branches"),refetchInterval:3e4}).data;return!s||!s.here.length&&!s.remote.length?null:t.jsxs("div",{className:"box",style:{marginTop:18},children:[t.jsxs("b",{children:[t.jsx(Qm,{size:14})," Left over from released tickets"]}),t.jsxs("p",{className:"note",style:{margin:"4px 0 8px"},children:[[s.here.length?`${s.here.length} on this computer`:"",s.remote.length?`${s.remote.length} in your team's shared copy of the code`:""].filter(Boolean).join(" and "),". Their work is in the code already, so nothing is lost."]}),t.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[s.here.length>0&&t.jsx("button",{className:"btn sm",disabled:e.isPending,onClick:()=>e.mutate({path:"/api/v1/branches/clean",body:{remote:!1},done:"Deleted what was left over on this computer"}),children:"Delete them here"}),s.remote.length>0&&t.jsxs("button",{className:"btn sm",disabled:e.isPending,onClick:()=>e.mutate({path:"/api/v1/branches/clean",body:{remote:!0},done:"Deleted what was left over here and in the shared copy of the code"}),children:["Delete them ",s.here.length?"here and ":"","in the shared copy"]}),t.jsx("span",{className:"grow",style:{flex:1}}),t.jsx(X,{text:s.remote.length?"squad branches --clean --remote":"squad branches --clean"})]})]})}function ZD({version:e,onClose:n,onDone:s}){const r=Ot(),{toast:i}=Le(),[a,l]=N.useState(""),[c,u]=N.useState(null),[h,m]=N.useState(!1),p=async x=>{m(!0);try{const g=await et(`/api/v1/releases/${e}/mark-sent`,"POST",{reason:a,...x?{anyway:x}:{}});r.invalidateQueries(),s(g),n()}catch(g){g instanceof uu&&g.status===409?u(g.message):i(g instanceof Error?g.message:String(g),"err")}finally{m(!1)}};return t.jsxs(Ye,{title:"It reached it another way",onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),c?t.jsx("button",{className:"btn pri",disabled:h||!a.trim(),onClick:()=>void p(!0),children:"Mark it anyway"}):t.jsx("button",{className:"btn pri",disabled:h||!a.trim(),onClick:()=>void p(!1),children:h?"Looking for it…":"Mark it as sent"})]}),children:[t.jsxs("p",{className:"note",children:[e,"'s tickets close, and nothing checks after this. squad-kit looks in your team's shared copy of the code first."]}),t.jsx("div",{className:"lbl",children:"How did it get there?"}),t.jsx("textarea",{className:"waynote",rows:2,dir:je(a),value:a,onChange:x=>l(x.target.value),placeholder:"For example: Sara merged it by hand"}),c&&t.jsx("div",{className:"box",style:{marginTop:10},children:c}),t.jsx("div",{style:{marginTop:10},children:t.jsx(X,{text:`squad release ${e} --mark-sent --reason ${Me(a.trim()||"how it got there")}${c?" --anyway":""}`})})]})}function XD({r:e,onReleased:n}){const s=re(),[r,i]=N.useState(""),a=c=>s.mutate({path:`/api/v1/releases/${e.version}/release`,...c?{body:{goOn:c}}:{}},{onSuccess:n}),l=e.gateStop.filter(c=>c.output);return t.jsxs("div",{className:"box",role:"alert",style:{marginTop:12},children:[t.jsxs("b",{children:[e.version," did not go out. Nothing changed."]}),e.gateStop.map(c=>t.jsxs("p",{dir:"auto",children:["Your team's check ",t.jsx("b",{children:c.name})," ",c.result==="failed"?"did not pass.":`could not run. ${c.why??""}`]},c.id)),l.length>0&&t.jsxs("details",{children:[t.jsx("summary",{children:"Let an engineer look"}),t.jsx("pre",{className:"mono",dir:"ltr",style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",fontSize:12},children:l.map(c=>`${c.name}:
734
+ ${c.output}`).join(`
735
+
736
+ `)})]}),t.jsxs("div",{className:"field",style:{marginTop:10},children:[t.jsx("label",{htmlFor:"gate-why",children:"To go on without this check, write why. It stays on the stories and the release notes."}),t.jsx("textarea",{id:"gate-why",className:"textarea",dir:je(r),value:r,onChange:c=>i(c.target.value)})]}),t.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[t.jsx("button",{className:"btn pri sm",disabled:s.isPending,onClick:()=>a(),children:"Try again"}),t.jsx("button",{className:"btn sm",disabled:s.isPending||!r.trim(),onClick:()=>a(r.trim()),children:"Go on without this check"})]})]})}function JD(){const[e,n]=N.useState(void 0),s=ve({queryKey:["backlog",e??""],queryFn:()=>ye(`/api/v1/backlog${e?`?sprint=${encodeURIComponent(e)}`:""}`),refetchInterval:15e3}),r=s.data,i=ve({queryKey:["tracker"],queryFn:()=>ye("/api/v1/tracker")}).data?.label??"the tracker",a=e??r?.sprint,l=r?.sprints.find(c=>c.path===a)?.name;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Backlog"}),r?.connected&&r.sprints.length>0&&t.jsxs("select",{className:"input",style:{width:"auto",marginLeft:12},value:a??"all",onChange:c=>n(c.target.value),"aria-label":"Sprint",children:[r.sprints.map(c=>t.jsxs("option",{value:c.path,children:[es(c.name),c.current?" (now)":""]},c.path)),t.jsx("option",{value:"all",children:"Everything open"})]}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:l?`squad backlog --sprint ${Me(l)}`:"squad backlog"})]}),t.jsx("div",{className:"scroll",children:t.jsx("div",{className:"page",children:s.isLoading?t.jsxs("p",{className:"note",children:["Reading the backlog from ",i,"…"]}):r?.connected?r.error?t.jsx("p",{className:"note",style:{color:"var(--bug)"},children:r.error}):r.items.length===0?t.jsxs("p",{className:"note",children:["Nothing open in ",l??"this sprint","."]}):t.jsxs(t.Fragment,{children:[t.jsxs("p",{className:"note",style:{marginBottom:12},children:[r.items.length," open ",r.items.length===1?"item":"items"," in ",l??"the backlog",", in backlog order. Start one and the squad picks it up; ",i," follows along.",r.capped&&" There are more: only the first 500 are shown. Pick a sprint here, or a view or Status in Settings, to see the rest."]}),t.jsxs("table",{className:"table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{style:{width:80},children:"ID"}),t.jsx("th",{children:"Title"}),t.jsx("th",{style:{width:70},children:"Points"}),t.jsxs("th",{style:{width:100},children:["On ",i]}),t.jsx("th",{style:{width:260},children:"squad-kit"})]})}),t.jsx("tbody",{children:r.items.map(c=>t.jsx(eB,{w:c},c.id))})]})]}):t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:t.jsx(rb,{size:18})}),t.jsxs("div",{children:[t.jsx("b",{children:"Connect a tracker"}),t.jsxs("span",{children:[r?.error??"Connect your tracker in Settings, and your stories and bugs show up here."," ",t.jsx(ge,{to:"/settings",style:{fontWeight:600},children:"Open Settings"})]})]})]})})})]})}function eB({w:e}){const n=re();return t.jsxs("tr",{children:[t.jsx("td",{className:"mono",children:t.jsxs("a",{href:e.url,target:"_blank",rel:"noreferrer",style:{display:"inline-flex",alignItems:"center",gap:4},children:[e.ref," ",t.jsx(Xt,{size:11})]})}),t.jsx("td",{...ze(e.title),children:t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[e.isBug&&t.jsxs("span",{className:"pill bug",style:{padding:"2px 8px"},children:[t.jsx(Js,{size:12})," Bug"]}),t.jsx(R,{style:{fontWeight:600},text:e.title})]})}),t.jsx("td",{children:e.points??""}),t.jsx("td",{children:e.state}),t.jsx("td",{children:e.ticket?t.jsxs(ge,{to:"/board",search:{ticket:e.ticket.id},style:{color:"var(--muted)"},children:[t.jsx("b",{className:"mono",style:{color:"var(--text)"},children:e.ticket.id})," ",e.ticket.stage==="done"?"Released":er[e.ticket.stage]]}):t.jsxs("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>n.mutate({path:`/api/v1/backlog/${encodeURIComponent(e.id)}/start`,done:`${e.ref} is on the board. The Analyst is reading it.`}),children:[t.jsx(kn,{size:13})," Start"]})})]})}const Hu=["Structure","Data","Security","Interface","Rules"],Df={shipped:"Released",merged:"Merged, not released yet",building:"Being built",designed:"Designed, not built yet",coming:"Coming"};function tB(){const e=DS(),n=_r({from:"/architecture"}),s=_t(),r=n.view??"map",[i,a]=N.useState(new Set),[l,c]=N.useState(null),[u,h]=N.useState(!1),[m,p]=N.useState(null),x=e.data?.decisions??[],g=I=>I.startsWith("ADR-")||x.some(D=>D.id===I)?{kind:"adr",id:I}:{kind:"ticket",id:I},j=n.adr?g(n.adr):null,k=I=>void s({to:"/architecture",search:{...(I.view??r)!=="map"?{view:I.view??r}:{},..."pick"in I?I.pick?{adr:I.pick.id}:{}:n.adr?{adr:n.adr}:{}},replace:!0}),b=I=>k({pick:j?.id===I?.id?null:I}),w=e.data?.tickets??[],S=N.useMemo(()=>mB(x,w),[x,w]),T=S.cols.length,E=l??T;if(N.useEffect(()=>{if(!u)return;const I=setInterval(()=>{c(D=>{const M=(D??0)+1;return M>=T?(h(!1),null):M})},700);return()=>clearInterval(I)},[u,T]),!e.data)return t.jsx("div",{className:"top",children:t.jsx("h1",{children:"Architecture"})});const z=x.filter(I=>S.colOf(I.from)<E),$=z.filter(I=>!I.replacedBy||S.colOf(L5(x,I.replacedBy))>=E),P=S.cols.slice(0,E).reduce((I,D)=>I+(D.t?.follows.length??0),0),L=m?g(m):j,W=fB(L,x,w),F=r==="map"||r==="timeline",U=e.data.lessons??[];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Architecture"}),t.jsx("span",{className:"note",children:"Every technical choice the squad made, why, and what it shaped. Every new ticket follows the rules in force."})]}),t.jsx("div",{className:"ptabs",role:"tablist",children:[["map","Map"],["timeline","Timeline"],["stack","Stack",e.data.stack.length],["list","All decisions",x.length],["project","Project map"],["lessons","Lessons",U.length]].map(([I,D,M])=>t.jsxs("button",{role:"tab","aria-selected":r===I,className:r===I?"on":"",onClick:()=>k({view:I}),children:[D," ",M!==void 0&&t.jsx("span",{className:"n",children:M})]},I))}),t.jsxs("div",{className:"split",children:[t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"arch",children:[(e.data?.broken?.length??0)>0&&t.jsx(ml,{list:e.data.broken,label:"Decisions that could not be read"}),F&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"arch-stats",children:[t.jsx(od,{n:$.length,label:"Rules in force",hint:"Every new design must follow these"}),t.jsx(od,{n:z.length-$.length,label:"Replaced",hint:"Changed by a newer decision"}),t.jsx(od,{n:$.filter(I=>I.checkedBy?.passing).length,label:"Checked by a test",hint:"Break one and nothing ships"}),t.jsx(od,{n:P,label:"Times a design followed one",hint:"Past choices shaping new work"})]}),t.jsxs("div",{className:"arch-bar",children:[t.jsxs("button",{className:"btn",onClick:()=>u?h(!1):(c(l===null||l>=T?1:l),h(!0)),children:[u?t.jsx(Nl,{size:14}):t.jsx(kn,{size:14})," ",u?"Pause":"Play the history"]}),t.jsx("input",{type:"range",min:1,max:T,value:E,"aria-label":"Show the project up to this ticket",onChange:I=>{h(!1);const D=Number(I.target.value);c(D>=T?null:D)}}),t.jsx("span",{className:"note mono",style:{minWidth:110},children:E>=T?"Today":`Up to ${S.cols[E-1]?.label??""}`}),t.jsx("span",{className:"grow"}),[...Hu,"Other"].filter(I=>x.some(D=>(D.area??"Other")===I)).map(I=>t.jsxs("button",{className:`chip area-${I.toLowerCase()} ${i.has(I)?"on":""}`,onClick:()=>a(D=>{const M=new Set(D);return M.has(I)?M.delete(I):M.add(I),M}),children:[t.jsx("i",{})," ",I]},I))]})]}),r==="map"&&t.jsx(aB,{decisions:x.filter(I=>i.size===0||i.has(I.area??"Other")),tickets:w,visible:I=>S.colOf(I.from)<E,related:W,picked:j?.id??null,onPick:b,onHover:p}),r==="timeline"&&t.jsx(cB,{decisions:x,tickets:w,areas:i,shown:E,related:W,picked:j?.id??null,onPick:b,g:S}),F&&t.jsx(iB,{view:r}),r==="map"&&t.jsx(dB,{decisions:x,tickets:w,onPick:b}),r==="stack"&&t.jsx(nB,{data:e.data,picked:j?.id??null,onPick:b}),r==="list"&&t.jsx(uB,{decisions:x,picked:j?.id??null,onPick:b}),r==="project"&&t.jsxs("div",{style:{maxWidth:820},children:[t.jsxs("p",{className:"note",style:{marginBottom:8,display:"flex",gap:8,alignItems:"center"},children:[t.jsx(lS,{size:15})," The Architect writes this from the code and reads it again after every merge. Every agent reads it first, then opens only the files it needs."]}),t.jsx(F5,{reading:e.data.reading}),e.data.map.map(I=>t.jsxs("div",{className:"maprow",children:[t.jsx(R,{as:"b",text:I.area}),t.jsx(R,{text:I.detail})]},I.area))]}),r==="lessons"&&t.jsxs("div",{style:{maxWidth:820},children:[t.jsx("p",{className:"note",style:{marginBottom:8},children:"Learned from bugs and reviews. Each lesson makes the next ticket better."}),U.length===0&&t.jsx("p",{className:"note",children:"No lessons yet."}),U.map(I=>t.jsxs("div",{className:"lesson",children:[t.jsx("span",{className:"glyph sm",children:t.jsx(aS,{size:12})}),t.jsxs(R,{text:I.text,children:[" ",t.jsxs("span",{className:"note",dir:"ltr",children:["From ",I.from]})]}),t.jsx("span",{className:"mono",children:Ls(I.date)})]},I.id))]})]})}),r!=="project"&&r!=="lessons"&&t.jsx(hB,{pick:j,decisions:x,tickets:w,impact:e.data.impact??[],onPick:b})]})]})}const I5=[{role:"Language",label:"Language and runtime"},{role:"Framework",label:"App framework"},{role:"Interface",label:"Screens"},{role:"Data",label:"Data"},{role:"Services",label:"Outside services"},{role:"Testing",label:"Testing"},{role:"Tooling",label:"Tooling"}];function nB({data:e,picked:n,onPick:s}){const r=e.stack.filter(a=>!a.decisions.length&&!a.via).length,i=e.stack.filter(a=>!a.decisions.length&&a.via).length;return t.jsxs("div",{className:"stackv",children:[t.jsx(F5,{reading:e.reading}),t.jsxs("div",{className:"stack-sum",children:[t.jsxs("span",{children:[t.jsx("b",{children:e.stack.length})," technologies in the code"]}),t.jsxs("span",{children:[t.jsx("b",{children:e.stack.length-r-i})," chosen by a saved decision"]}),i>0&&t.jsxs("span",{children:[t.jsx("b",{children:i})," came with one of those"]}),r>0&&t.jsxs("span",{className:"ahead",children:[t.jsx("b",{children:r})," picked while building, no decision yet"]}),t.jsxs("span",{children:[t.jsx("b",{children:e.patterns.length})," design patterns"]})]}),e.stack.length===0&&t.jsx("p",{className:"note",children:"None found yet. The Architect lists them when it reads the code."}),t.jsxs("section",{className:"stack-group",children:[t.jsx("h3",{children:"Technologies"}),t.jsx("div",{className:"techs",children:I5.flatMap(a=>e.stack.filter(l=>l.role===a.role)).map(a=>t.jsx(sB,{t:a,picked:n,onPick:s},a.name))})]}),t.jsxs("section",{className:"stack-group",children:[t.jsx("h3",{children:"Design patterns the code follows"}),e.patterns.length===0&&t.jsx("p",{className:"note",children:"Not read yet. Press Read the code again, and the Architect lists the patterns a new developer must keep."}),t.jsx("div",{className:"patterns",children:e.patterns.map(a=>t.jsxs("div",{className:"pattern",children:[t.jsx("span",{className:"glyph sm",children:t.jsx(xS,{size:13})}),t.jsxs("div",{children:[t.jsx(R,{as:"b",text:a.name}),t.jsx(R,{as:"p",text:a.what}),t.jsxs("div",{className:"where",children:[a.where.map(l=>t.jsx("code",{children:l},l)),a.decision&&t.jsxs("button",{className:`pill click ${n===a.decision?"on":""}`,onClick:()=>s({kind:"adr",id:a.decision}),children:["From ",a.decision]})]})]})]},a.name))})]})]})}function sB({t:e,picked:n,onPick:s}){const r=e.icon?J4[e.icon]:void 0;return t.jsxs("div",{className:`tech ${e.decisions.some(i=>i===n)?"picked":""}`,children:[t.jsxs("div",{className:"tech-head",children:[t.jsx("span",{className:"logo",style:r?{"--brand":`#${r.hex}`}:void 0,children:r?t.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:qO(r.hex)?"ink":"",children:t.jsx("path",{d:r.path})}):t.jsx("span",{className:"mono",children:e.name.slice(0,2)})}),t.jsxs("span",{className:"tech-name",children:[t.jsx("b",{children:e.name}),e.version&&t.jsxs("span",{className:"mono",children:["v",e.version]})]}),t.jsx("span",{className:"tech-role",children:I5.find(i=>i.role===e.role)?.label})]}),t.jsx(R,{as:"p",className:e.why?"":"note",text:e.why??"Not explained yet. The Architect fills this in when it reads the code."}),t.jsx("div",{className:"tech-foot",children:e.decisions.length?e.decisions.map(i=>t.jsxs("button",{className:`pill click ${n===i?"on":""}`,onClick:()=>s({kind:"adr",id:i}),children:["Chosen in ",i]},i)):e.via?e.via.decisions.map(i=>t.jsxs("button",{className:`pill click ${n===i?"on":""}`,onClick:()=>s({kind:"adr",id:i}),title:`Choosing ${e.via.name} chose ${e.name} too`,children:["Comes with ",e.via.name," · ",i]},i)):t.jsx(rB,{t:e})})]})}function rB({t:e}){const n=re(),s=(i,a)=>n.mutate({path:"/api/v1/architecture/decide",body:{tech:e.name,do:i},done:a}),r=e.draft;if(r?.status==="writing"||n.isPending&&!r)return t.jsxs("span",{className:"pill nodecision",children:[t.jsx(Xe,{size:12,className:"spin"})," The Architect is writing it"]});if(r?.status==="ready"&&r.decision){const i=r.decision;return t.jsxs("div",{className:"techdraft",children:[t.jsx("span",{className:"lbl",children:"Decision for you to approve"}),t.jsx(R,{as:"b",text:i.title}),t.jsx(R,{as:"p",lead:t.jsx("span",{className:"note",children:"Chosen:"}),text:i.chosen}),t.jsx(R,{as:"p",text:i.why}),i.options.filter(a=>a!==i.chosen).length>0&&t.jsx(R,{as:"p",className:"note",lead:"Also looked at:",text:i.options.filter(a=>a!==i.chosen).join("; ")}),t.jsxs("div",{className:"row",children:[t.jsxs("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>s("approve","Saved as a decision. Every new ticket follows it now."),children:[t.jsx(ce,{size:13})," Approve"]}),t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>s("discard"),children:"Discard"})]})]})}return t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"pill nodecision",title:r?.status==="failed"?`The last try stopped: ${r.error??""}`:"The Builder added it while building; nobody wrote down why.",children:r?.status==="failed"?"Writing stopped, try again":"Picked while building"}),t.jsx("button",{className:"btn sm",onClick:()=>s("write",`The Architect is writing a decision for ${e.name}.`),children:"Save as a decision"})]})}function F5({reading:e}){const n=re(),s=e?.status==="pending"||e?.status==="running"||n.isPending;return t.jsxs("div",{className:`reading ${e?.status==="failed"?"bad":""}`,children:[s?t.jsx(Xe,{size:15,className:"spin"}):t.jsx(xs,{size:15}),t.jsx("span",{children:s?"The Architect is reading the code. This takes a minute or two.":e?.status==="failed"?`The last read stopped: ${e.error??"unknown error"}`:e?.at?`Read from the code ${st(e.at)}. It is read again after every merge.`:"Not read from the code yet."}),t.jsx("span",{className:"grow"}),t.jsxs("button",{className:"btn sm",disabled:s,onClick:()=>n.mutate({path:"/api/v1/architecture/read",done:"The Architect is reading the code."}),children:[t.jsx(xs,{size:13})," Read the code again"]})]})}function od({n:e,label:n,hint:s}){return t.jsxs("div",{className:"arch-stat",title:s,children:[t.jsx("b",{children:e}),t.jsx("span",{children:n}),t.jsx("small",{children:s})]})}function iB({view:e}){return e==="map"?t.jsxs("div",{className:"arch-legend note",children:[t.jsxs("span",{children:[t.jsx("i",{className:"lg arrow"})," Built on"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg arrow replaces"})," Replaces"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg chip made"})," Ticket that made it"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg chip"})," Ticket that followed it"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg chip ahead"})," Will follow it, not built yet"]}),t.jsxs("span",{children:[t.jsx(ce,{size:12,strokeWidth:3})," Checked by a test"]})]}):t.jsxs("div",{className:"arch-legend note",children:[t.jsxs("span",{children:[t.jsx("i",{className:"lg node"})," Made the decision"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg dot"})," Its design followed it"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg dot open"})," Will follow it, not built yet"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg link"})," Built on an older one"]}),t.jsxs("span",{children:[t.jsx("i",{className:"lg link replaces"})," Replaces an older one"]})]})}const aa=112,Tm=18,qo=16,Tk=34;function aB({decisions:e,tickets:n,visible:s,related:r,picked:i,onPick:a,onHover:l}){const[c,u]=N.useState(1100),h=N.useRef(null);N.useEffect(()=>{const L=h.current;if(!L)return;const W=new ResizeObserver(()=>u(L.clientWidth));return W.observe(L),()=>W.disconnect()},[]);const m=new Set(e.map(L=>L.id)),p=L=>[...L.buildsOn??[],...L.replaces?[L.replaces]:[]].filter(W=>m.has(W)),x=new Map,g=(L,W=new Set)=>{if(x.has(L.id))return x.get(L.id);if(W.has(L.id))return 0;W.add(L.id);const F=p(L).map(I=>e.find(D=>D.id===I)),U=F.length?1+Math.max(...F.map(I=>g(I,W))):0;return x.set(L.id,U),U},j=[...Hu,"Other"],k=[];for(const L of e)(k[g(L)]??=[]).push(L);const b=k.length>4?30:46,w=Math.max(150,Math.min(270,(c-qo*2-Math.max(0,k.length-1)*b)/Math.max(1,k.length)));for(const L of k)L?.sort((W,F)=>j.indexOf(W.area??"Other")-j.indexOf(F.area??"Other")||Ek(W.id)-Ek(F.id));const S=Math.max(1,...k.map(L=>L?.length??0)),T=Tk+S*(aa+Tm)+qo,E=new Map;k.forEach((L,W)=>{const F=(S-(L?.length??0))*(aa+Tm)/2;L?.forEach((U,I)=>E.set(U.id,{x:qo+W*(w+b),y:Tk+F+I*(aa+Tm)}))});const z=qo*2+k.length*w+Math.max(0,k.length-1)*b,$=L=>r!==null&&!r.has(L),P=["Starting points","Built on them","One more level","And on those","And further"];return t.jsx("div",{className:"dmap",ref:h,onMouseLeave:()=>l(null),children:t.jsxs("div",{className:"dmap-canvas",style:{width:z,height:T},children:[k.map((L,W)=>t.jsx("span",{className:"dmap-layer",style:{left:qo+W*(w+b),width:w},children:P[W]??`Level ${W+1}`},W)),t.jsxs("svg",{width:z,height:T,className:"dmap-edges",children:[t.jsxs("defs",{children:[t.jsx("marker",{id:"arr",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:t.jsx("path",{d:"M0 1 L9 5 L0 9 z",className:"arrhead"})}),t.jsx("marker",{id:"arr-r",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:t.jsx("path",{d:"M0 1 L9 5 L0 9 z",className:"arrhead replaces"})})]}),e.flatMap(L=>{const W=E.get(L.id);return!W||!s(L)?[]:[...(L.buildsOn??[]).map(U=>({p:U,kind:"built"})),...L.replaces?[{p:L.replaces,kind:"replaces"}]:[]].map(({p:U,kind:I})=>{const D=E.get(U),M=e.find(B=>B.id===U);if(!D||!M||!s(M))return null;const Y=D.x+w,ae=D.y+aa/2,H=W.x-2,Z=W.y+aa/2,ue=Math.max(40,(H-Y)/2),q=r!==null&&r.has(L.id)&&r.has(U);return t.jsx("path",{className:`edge ${I} ${$(L.id)||$(U)?"off":""} ${q?"lit":""}`,d:`M${Y} ${ae} C${Y+ue} ${ae}, ${H-ue} ${Z}, ${H} ${Z}`,markerEnd:`url(#${I==="replaces"?"arr-r":"arr"})`},`${U}-${L.id}-${I}`)})})]}),e.map(L=>{const W=E.get(L.id),F=L.tickets.filter(M=>M!==L.from),U=n.filter(M=>(M.state==="designed"||M.state==="coming")&&M.follows.includes(L.id)&&!F.includes(M.id)),I=[L.from==="Project scan"?"Scan":L.from,...F],D=I.length+U.length-6;return t.jsxs("button",{className:`dcard area-${(L.area??"Other").toLowerCase()} ${s(L)?"":"later"} ${$(L.id)?"off":""} ${i===L.id?"picked":""} ${L.replacedBy?"old":""}`,style:{left:W.x,top:W.y,width:w,height:aa},onClick:()=>a({kind:"adr",id:L.id}),onMouseEnter:()=>l(L.id),children:[t.jsxs("span",{className:"dhead",children:[t.jsx("i",{}),t.jsx("span",{className:"mono",children:L.id}),t.jsx("span",{className:"darea",children:L.area??"Other"}),L.checkedBy?.passing&&t.jsx(ce,{size:13,strokeWidth:3,className:"dtest","aria-label":"Checked by a test"})]}),t.jsx(R,{as:"b",className:"dtitle",text:L.title}),t.jsx("span",{className:"dchips",children:L.replacedBy?t.jsxs("span",{className:"dchip ahead",children:["Replaced by ",L.replacedBy]}):t.jsxs(t.Fragment,{children:[I.slice(0,6).map((M,Y)=>t.jsx("span",{className:`dchip ${Y===0?"made":""}`,title:Y===0?"Made this decision":"Its design followed it",children:M},M)),U.slice(0,Math.max(0,6-I.length)).map(M=>t.jsx("span",{className:"dchip ahead",title:"Designed, not built yet: will follow it",children:M.id},M.id)),D>0&&t.jsxs("span",{className:"dchip",children:["+",D]})]})})]},L.id)})]})})}const Em=30,oB=26,ld=250,lB=62;function cB({decisions:e,areas:n,shown:s,related:r,picked:i,onPick:a,g:l}){const[c,u]=N.useState(1e3),h=N.useRef(null);N.useEffect(()=>{const $=h.current;if(!$)return;const P=new ResizeObserver(()=>u($.clientWidth));return P.observe($),()=>P.disconnect()},[]);const m=l.cols.length,p=Math.max(40,Math.min(64,(c-ld-24)/Math.max(1,m))),x=l.rows.filter($=>n.size===0||n.has($.area)),g=new Map;let j=lB+8,k="";const b=[];for(const $ of x)$.area!==k&&(k=$.area,j+=oB,b.push({area:$.area,y:j-18})),g.set($.d.id,j),j+=Em;const w=j+12,S=ld+m*p+16,T=$=>ld+$*p+p/2,E=$=>$<s,z=$=>r!==null&&!r.has($);return t.jsx("div",{className:"arch-graph",ref:h,children:t.jsxs("svg",{width:S,height:w,role:"img","aria-label":"Decisions over time, and the tickets that followed them",children:[l.cols.map(($,P)=>t.jsxs("g",{className:`col state-${$.t?.state??"scan"} ${E(P)?"":"later"} ${z($.key)?"dim":""}`,onClick:()=>$.t&&a({kind:"ticket",id:$.key}),children:[t.jsx("rect",{className:"colbg",x:ld+P*p+2,y:6,width:p-4,height:w-12,rx:10}),t.jsx("text",{className:"colid",x:T(P),y:26,textAnchor:"middle",children:$.label}),t.jsx("circle",{className:"colstate",cx:T(P),cy:42,r:4}),t.jsx("title",{children:$.t?`${$.t.id} · ${$.t.title}
737
+ ${Df[$.t.state]}`:"What the Architect found when it first read the project"})]},$.key)),b.map($=>t.jsx("text",{className:`lane area-${$.area.toLowerCase()}`,x:14,y:$.y,children:$.area.toUpperCase()},$.area)),x.map($=>{const P=g.get($.d.id),L=l.colOf($.d.from);if(!E(L))return null;const W=$.d.replacedBy?l.colOf(L5(e,$.d.replacedBy)):m-1,F=Math.min(W,s-1),U=`track area-${$.area.toLowerCase()} ${z($.d.id)?"dim":""} ${i===$.d.id?"picked":""}`;return t.jsxs("g",{className:U,onClick:()=>a({kind:"adr",id:$.d.id}),children:[t.jsx("rect",{className:"hit",x:0,y:P-Em/2,width:S,height:Em}),t.jsxs("text",{className:"name",x:14,y:P+4,children:[t.jsx("tspan",{className:"rid",children:$.d.id})," ",es(gB($.d.title,28))]}),t.jsx("line",{className:`rail ${$.d.replacedBy&&W<s?"gone":""}`,x1:T(L),x2:T(F)+($.d.replacedBy?0:p/2),y1:P,y2:P}),l.cols.map((I,D)=>D>L&&E(D)&&I.t?.follows.includes($.d.id)?t.jsx("circle",{className:`dot ${I.t.state==="designed"||I.t.state==="coming"?"open":""}`,cx:T(D),cy:P,r:5,children:t.jsx("title",{children:`${I.t.id} followed ${$.d.id}`})},I.key):null),t.jsx("circle",{className:`node ${$.d.replacedBy?"old":""}`,cx:T(L),cy:P,r:8}),$.d.checkedBy?.passing&&t.jsx("path",{className:"tick",d:`M${T(L)-3.5} ${P} l2.5 2.6 l4.8 -5`}),t.jsx("title",{children:`${$.d.id} · ${$.d.title}
738
+ Chosen: ${$.d.chosen}`})]},$.d.id)}),x.flatMap($=>{const P=g.get($.d.id),L=l.colOf($.d.from);return E(L)?[...($.d.buildsOn??[]).map(F=>({b:F,kind:"built"})),...$.d.replaces?[{b:$.d.replaces,kind:"replaces"}]:[]].map(({b:F,kind:U})=>{const I=g.get(F);if(I===void 0)return null;const D=P>I?1:-1;return t.jsxs("g",{className:`link ${U} ${z($.d.id)||z(F)?"dim":""}`,children:[t.jsx("path",{d:`M${T(L)} ${I+6*D} L${T(L)} ${P-9*D}`}),t.jsx("circle",{cx:T(L),cy:I,r:3.2})]},`${$.d.id}-${F}-${U}`)}):[]})]})})}function dB({decisions:e,tickets:n,onPick:s}){return t.jsxs("div",{className:"arch-cards",children:[t.jsxs("div",{className:"arch-card",children:[t.jsx("h4",{children:"What a new ticket inherits today"}),t.jsx("p",{className:"note",children:"The Architect, the Builder and the Reviewer read all of these before they start."}),[...Hu,"Other"].map(r=>{const i=e.filter(a=>!a.replacedBy&&(a.area??"Other")===r);return i.length?t.jsxs("div",{className:`inherit area-${r.toLowerCase()}`,children:[t.jsxs("b",{children:[t.jsx("i",{})," ",r]}),i.map(a=>t.jsx("button",{...ze(a.title),onClick:()=>s({kind:"adr",id:a.id}),children:t.jsx(R,{lead:t.jsx("span",{className:"mono",children:a.id}),text:a.title})},a.id))]},r):null})]}),t.jsxs("div",{className:"arch-card",children:[t.jsx("h4",{children:"Coming next"}),t.jsx("p",{className:"note",children:"Tickets not built yet, and the past decisions that will shape them."}),n.filter(r=>r.state==="designed"||r.state==="coming").map(r=>t.jsxs("div",{className:"coming",children:[t.jsx("button",{...ze(r.title),onClick:()=>s({kind:"ticket",id:r.id}),children:t.jsx(R,{lead:t.jsx("span",{className:"mono",children:r.id}),text:r.title})}),t.jsx("span",{className:"pills",children:r.follows.length?r.follows.map(i=>t.jsx("button",{className:"pill click",onClick:()=>s({kind:"adr",id:i}),children:i},i)):t.jsxs("span",{className:"note",children:["Not designed yet. Will read the ",e.filter(i=>!i.replacedBy).length," rules in force."]})})]},r.id))]})]})}function uB({decisions:e,picked:n,onPick:s}){return t.jsxs("table",{className:"table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{style:{width:90},children:"ID"}),t.jsx("th",{children:"Decision"}),t.jsx("th",{style:{width:110},children:"Area"}),t.jsx("th",{style:{width:120},children:"From"}),t.jsx("th",{style:{width:150},children:"Checked by"})]})}),t.jsx("tbody",{children:[...e].reverse().map(r=>t.jsxs("tr",{className:`click ${n===r.id?"on":""}`,onClick:()=>s({kind:"adr",id:r.id}),children:[t.jsx("td",{className:"mono",children:r.id}),t.jsxs("td",{style:{fontWeight:n===r.id?600:500,color:r.replacedBy?"var(--dim)":void 0},...ze(r.title),children:[r.replacedBy?t.jsx("s",{children:t.jsx(Jt,{text:r.title,dir:ze(r.title).dir})}):t.jsx(Jt,{text:r.title,dir:ze(r.title).dir})," ",r.replacedBy&&t.jsxs("span",{className:"pill wait",children:["Replaced by ",r.replacedBy]})]}),t.jsx("td",{children:t.jsxs("span",{className:`areatag area-${(r.area??"Other").toLowerCase()}`,children:[t.jsx("i",{})," ",r.area??"Other"]})}),t.jsx("td",{style:{color:"var(--muted)",fontSize:13},children:r.from}),t.jsx("td",{children:r.checkedBy?r.checkedBy.passing?t.jsxs("span",{className:"pill ok",children:[t.jsx(ce,{size:13,strokeWidth:2.5})," A ",r.checkedBy.kind]}):t.jsx("span",{className:"pill you",children:"Test being written"}):t.jsx("span",{className:"pill wait",children:"Not checkable"})})]},r.id))})]})}function hB({pick:e,decisions:n,tickets:s,impact:r,onPick:i}){const a=p=>t.jsx("button",{className:"pill click",onClick:()=>i({kind:"adr",id:p}),children:p},p),l=p=>{const x=s.find(g=>g.id===p);return t.jsx("button",{className:`pill click st-${x?.state??"shipped"}`,title:x?`${x.title} · ${Df[x.state]}`:p,onClick:()=>i({kind:"ticket",id:p}),children:p},p)};if(e?.kind==="ticket"){const p=s.find(x=>x.id===e.id);return p?t.jsxs("aside",{className:"sidepanel arch-side",children:[t.jsxs("span",{className:"note mono",children:[p.id," · ",Df[p.state],p.release?` · ${p.release}`:""]}),t.jsx(R,{as:"h3",text:p.title}),t.jsx("div",{className:"lbl",children:"Decision it made"}),p.made?t.jsx(R,{as:"p",style:{fontSize:13.5},lead:a(p.made),text:n.find(x=>x.id===p.made)?.title??""}):t.jsx("p",{className:"note",children:"None. It worked inside the rules it had."}),t.jsx("div",{className:"lbl",children:"Past decisions its design followed"}),p.follows.length?t.jsx("div",{className:"pills",children:p.follows.map(a)}):t.jsx("p",{className:"note",children:p.state==="coming"?"Not designed yet. When it is, it reads every rule in force.":"None recorded."}),t.jsx("p",{style:{marginTop:18},children:t.jsx(ge,{to:"/board",search:{ticket:p.id},className:"btn",children:"Open the ticket"})})]}):t.jsx("aside",{className:"sidepanel arch-side",children:t.jsx("p",{className:"note",children:"That ticket is not on this board."})})}const c=e?.kind==="adr"?n.find(p=>p.id===e.id):void 0;if(!c)return t.jsxs("aside",{className:"sidepanel arch-side",children:[t.jsx("span",{className:"note mono",children:"HOW IT WORKS"}),t.jsx("h3",{children:"Every choice is remembered"}),t.jsx("p",{style:{fontSize:13.5,marginTop:8},children:"When a ticket needs a technical choice, the Architect writes it with the options and the why. You approve it with the design. From then on it is a rule: every later ticket reads it, and the tickets whose design used it are linked here."}),t.jsx("p",{style:{fontSize:13.5,marginTop:10},children:"A new decision can build on an older one, or replace it. A replaced decision stops being a rule, but its history stays."}),t.jsx("p",{className:"note",style:{marginTop:14},children:"Point at a decision to light up what it touched. Click it for the full story. Press Play to watch the project grow."})]});const u=n.filter(p=>p.buildsOn?.includes(c.id)),h=c.tickets.filter(p=>p!==c.from),m=s.filter(p=>(p.state==="designed"||p.state==="coming")&&p.follows.includes(c.id)&&!h.includes(p.id));return t.jsxs("aside",{className:"sidepanel arch-side",children:[t.jsxs("span",{className:"note mono",children:[c.id," · ",c.area??"Other"," · ",c.proposed?"found in the code, not approved yet":t.jsxs(t.Fragment,{children:["approved by ",t.jsx(R,{text:c.approvedBy})]})," · ",Ls(c.date)]}),t.jsx(R,{as:"h3",text:c.title}),c.proposed&&t.jsxs("div",{className:"box",style:{borderColor:"var(--you-line)",background:"var(--you-soft)",marginTop:8},children:[t.jsx("b",{children:"Proposed, not a rule yet."})," It becomes one when you approve the ",t.jsx(ge,{to:"/overview",children:"Overview"}),"."]}),c.replacedBy&&t.jsxs("div",{className:"box",style:{borderColor:"var(--you-line)",background:"var(--you-soft)",marginTop:8},children:[t.jsx("b",{children:"No longer a rule."})," Replaced by ",a(c.replacedBy),"."]}),t.jsx("div",{className:"lbl",children:"Chosen"}),t.jsx(R,{as:"p",style:{fontSize:13.5,fontWeight:600},text:c.chosen}),t.jsx("div",{className:"lbl",children:"Why"}),t.jsx(R,{as:"p",style:{fontSize:13.5},text:c.why}),c.options.length>1&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Also looked at"}),c.options.filter(p=>p!==c.chosen).map(p=>t.jsx(R,{as:"p",className:"note",style:{fontSize:13},text:p},p))]}),t.jsx("div",{className:"lbl",children:"Where it came from"}),t.jsxs("div",{className:"pills",style:{alignItems:"center"},children:[c.from==="Project scan"?t.jsx("span",{className:"pill",children:"Project scan"}):l(c.from),(c.buildsOn??[]).length>0&&t.jsx("span",{className:"note",children:"built on"}),(c.buildsOn??[]).map(a),c.replaces&&t.jsx("span",{className:"note",children:"replaces"}),c.replaces&&a(c.replaces)]}),t.jsx("div",{className:"lbl",children:"What it shaped"}),h.length||u.length?t.jsxs(t.Fragment,{children:[h.length>0&&t.jsx("p",{className:"note",style:{marginBottom:6},children:"Tickets whose design followed it"}),t.jsx("div",{className:"pills",children:h.map(l)}),u.length>0&&t.jsx("p",{className:"note",style:{margin:"10px 0 6px"},children:"Decisions built on it"}),t.jsx("div",{className:"pills",children:u.map(p=>a(p.id))})]}):t.jsx("p",{className:"note",children:"Nothing yet. Every new ticket reads it."}),m.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Still ahead"}),t.jsx("p",{className:"note",style:{marginBottom:6},children:"Designed, not built yet. They will follow it."}),t.jsx("div",{className:"pills",children:m.map(p=>l(p.id))})]}),t.jsx(pB,{d:c,check:r.find(p=>p.adr===c.id),tk:l}),t.jsx("div",{className:"lbl",children:"Checked by"}),c.checkedBy?t.jsxs("div",{className:"box",children:[t.jsx("b",{style:{color:c.checkedBy.passing?"var(--accent)":"var(--you-ink)"},children:c.checkedBy.passing?"Passing":"Being written"})," ",t.jsx("span",{className:"mono",style:{fontSize:12},children:c.checkedBy.name}),t.jsx("p",{className:"note",style:{marginTop:4},children:"If someone breaks this decision, the checks fail and nothing ships."})]}):t.jsx("p",{className:"note",children:"A fact about the project, nothing to test."})]})}function pB({d:e,check:n,tk:s}){const r=re();if(e.replacedBy)return null;const i=n?.status==="pending"||n?.status==="running"||r.isPending,a=()=>r.mutate({path:"/api/v1/architecture/impact",body:{adr:e.id},done:`The Architect is checking the open tickets against ${e.id}.`});return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Tickets planned before it"}),i?t.jsxs("p",{className:"note",style:{display:"flex",gap:8,alignItems:"center"},children:[t.jsx(Xe,{size:13,className:"spin"})," The Architect is checking the open tickets."]}):n?.status==="done"?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note",style:{marginBottom:6},children:n.checked?.length?`Checked ${n.checked.length} open ${n.checked.length===1?"ticket":"tickets"} ${n.at?st(n.at):""}. ${n.affected?.length?"These need a change, waiting for you:":"None need a change."}`:"No open ticket was planned before it."}),t.jsx("div",{className:"pills",children:(n.affected??[]).map(s)}),t.jsx("button",{className:"btn sm quiet",style:{marginTop:8},onClick:a,children:"Check again"})]}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note",style:{marginBottom:8},children:n?.status==="failed"?`The last check stopped: ${n.error??""}`:"Not checked yet. Plans written before it may still do it the old way."}),t.jsx("button",{className:"btn sm",onClick:a,children:"Check open tickets"})]})]})}function mB(e,n){const s=[];e.some(l=>!n.some(c=>c.id===l.from))&&s.push({key:"scan",label:"Scan"});for(const l of n)s.push({key:l.id,label:l.id,t:l});const r=l=>{const c=s.findIndex(u=>u.key===l);return c<0?0:c},i=[...Hu,"Other"],a=e.map(l=>({d:l,area:l.area??"Other"})).sort((l,c)=>i.indexOf(l.area)-i.indexOf(c.area)||r(l.d.from)-r(c.d.from));return{cols:s,rows:a,colOf:r}}function L5(e,n){return e.find(s=>s.id===n)?.from??""}function fB(e,n,s){if(!e)return null;const r=new Set([e.id]),i=c=>[...c.buildsOn??[],...c.replaces?[c.replaces]:[]];if(e.kind==="ticket"){const c=s.find(u=>u.id===e.id);for(const u of c?.follows??[])r.add(u);return c?.made&&r.add(c.made),r}const a=[e.id];for(;a.length;){const c=a.pop(),u=n.find(h=>h.id===c);for(const h of u?i(u):[])r.has(h)||(r.add(h),a.push(h))}const l=[e.id];for(;l.length;){const c=l.pop();for(const u of n)i(u).includes(c)&&!r.has(u.id)&&(r.add(u.id),l.push(u.id))}for(const c of[...r]){const u=n.find(h=>h.id===c);if(u&&c===e.id)for(const h of u.tickets)r.add(h);u&&r.add(u.from)}for(const c of s)c.follows.includes(e.id)&&r.add(c.id);return r}function gB(e,n){return e.length>n?`${e.slice(0,n-1).trimEnd()}…`:e}function Ek(e){return Number(e.replace(/\D/g,""))||0}function Ml(){return ve({queryKey:["sandbox"],queryFn:()=>ye("/api/v1/sandbox")})}function z5(){const e=Ml(),n=e.data?.note;return t.jsxs(t.Fragment,{children:[n&&t.jsxs("div",{className:"toolrow",children:[t.jsx("span",{className:"logo",children:t.jsx(c1,{size:18})}),t.jsxs("span",{style:{minWidth:0},children:[t.jsx("b",{children:n.title}),t.jsx("br",{}),t.jsx("span",{className:"note",children:n.text})]}),t.jsx("span",{className:"pill wait",children:"Less protected"})]}),(e.data?.tools??[]).map(s=>t.jsxs("div",{className:"toolrow",children:[t.jsx("span",{className:"logo",children:s.available?t.jsx(ja,{size:18}):t.jsx(Tj,{size:18})}),t.jsxs("span",{style:{minWidth:0},children:[t.jsx("b",{children:"The guard for the Builder and Tester"}),t.jsx("br",{}),s.available?t.jsxs("span",{className:"note",children:["Their commands run in ",s.why,": they write only in the ticket's copy, the proof folder and temp folders, reach only the websites the network level under Safety allows, and never read your keys, sign-ins or .env files."]}):t.jsxs("span",{className:"note",children:["Not available on this computer: ",s.why,". The Builder and Tester run as before, kept in their lane by squad-kit's own checks.",s.fix?` To turn it on: ${s.fix}.`:""]})]}),t.jsx("span",{className:`pill ${s.available?"ok":"wait"}`,children:s.available?"On":"Not available"})]},s.tool)),e.data?.guard&&t.jsxs("div",{className:"toolrow",children:[t.jsx("span",{className:"logo",children:e.data.guard.on?t.jsx(ja,{size:18}):t.jsx(Tj,{size:18})}),t.jsxs("span",{style:{minWidth:0},children:[t.jsx("b",{children:"Guard for the project's own commands"}),t.jsx("br",{}),e.data.guard.on?t.jsxs("span",{className:"note",children:["The project's own tests, setup and app run in ",e.data.guard.why,": they work normally and can reach the internet for packages and tests, but they cannot read your keys, sign-ins, squad-kit's own folder or the project's .env files. Only the setup after a merge reads the .env files of your own folder, as when you run it yourself. An engineer can allow a file they truly need in Settings."]}):t.jsxs("span",{className:"note",children:["Not available on this computer: ",e.data.guard.why,". The project's tests, setup and app run as before.",e.data.guard.fix?` To turn it on: ${e.data.guard.fix}.`:""]})]}),t.jsx("span",{className:`pill ${e.data.guard.on?"ok":"wait"}`,children:e.data.guard.on?"On":"Not available"})]}),e.data&&e.data.tools.some(s=>!s.available)&&t.jsx("div",{style:{marginTop:8},children:t.jsx(X,{text:"squad doctor"})})]})}function xB({net:e,live:n}){const s=re(),r=e.levels.find(i=>i.id===e.level)??e.levels[0];return t.jsxs("div",{className:"maprow",children:[t.jsx("b",{style:{paddingTop:4},children:"Network level"}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[t.jsxs("span",{className:"note",children:[t.jsxs("b",{children:[r.name,":"]})," ",r.words]}),e.level==="off"&&e.commands==="internet"&&t.jsx("span",{className:"note",children:"On this computer, Off closes the internet for the agents only: your project's own setup, tests and app still reach it."}),n&&t.jsxs("details",{children:[t.jsx("summary",{className:"note",children:"For engineers"}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:6,marginTop:6},children:[t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[e.levels.map(i=>t.jsx("button",{className:`btn sm ${i.id===e.level?"pri":""}`,"aria-pressed":i.id===e.level,disabled:s.isPending,onClick:()=>i.id!==e.level&&s.mutate({path:"/api/v1/settings",method:"PUT",body:{network:i.id},done:`The network level is ${i.name} now, from the next step`}),children:i.name},i.id)),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad config set network ${e.level}`})]}),e.levels.map(i=>t.jsxs("span",{className:"note",style:{fontSize:12.5,...i.id===e.level?{color:"var(--text)"}:{}},children:[t.jsxs("b",{children:[i.name,":"]})," ",i.words]},i.id)),t.jsx(yB,{})]})]})]})]})}function yB(){const n=Ml().data?.network?.blocked??[],s={standard:"Standard",strict:"Strict",off:"Off"};return n.length?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"note",children:[t.jsx("b",{children:"Refused lately."})," The work went on without each one. Allow a site below when the project truly needs it, or pick another level."]}),t.jsxs("table",{className:"table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Site"}),t.jsx("th",{children:"Story"}),t.jsx("th",{children:"Level"}),t.jsx("th",{children:"When"})]})}),t.jsx("tbody",{children:n.map(r=>t.jsxs("tr",{children:[t.jsx("td",{className:"mono",children:r.host}),t.jsx("td",{children:t.jsx(ge,{to:"/board",search:{ticket:r.story},children:r.story})}),t.jsx("td",{children:s[r.level]??r.level}),t.jsx("td",{children:st(r.at)})]},`${r.host}-${r.story}`))})]})]}):t.jsx("span",{className:"note",children:"No site was refused on this computer yet."})}function jB({hosts:e}){const n=re(),s=Ml(),[r,i]=N.useState(""),a=(u,h)=>n.mutate({path:"/api/v1/settings",method:"PUT",body:{allowedHosts:u},done:h},{onSuccess:()=>i("")}),l=()=>{const u=r.trim();u&&!n.isPending&&a([...e,u],`The squad may reach ${u} from its next step`)},c=s.data?.tools.length?s.data.tools.every(u=>!u.available):!1;return t.jsxs("div",{className:"maprow",children:[t.jsx("b",{style:{paddingTop:4},children:"Websites the squad may reach"}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[t.jsxs("span",{className:"note",children:["Allow a website here when the project needs one, for example your company's package server. The whole team shares this list.",s.data?.network?.level==="standard"?" On Standard the squad reaches it already: the list counts on Strict.":"",c?" This computer has no guard for them, so here they can reach any website.":""]}),e.length>0&&t.jsx("span",{className:"pills",children:e.map(u=>t.jsxs("span",{className:"pill mono",children:[u,t.jsx("button",{className:"linkbtn","aria-label":`Stop allowing ${u}`,title:`Stop allowing ${u}`,disabled:n.isPending,onClick:()=>a(e.filter(h=>h!==u),`The squad no longer reaches ${u}`),children:t.jsx(Ue,{size:12})})]},u))}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("input",{className:"input mono",style:{fontSize:13,flex:"1 1 200px",minWidth:0},value:r,placeholder:"packages.example.com","aria-label":"A website to allow",onChange:u=>i(u.target.value),onKeyDown:u=>u.key==="Enter"&&l()}),t.jsx("button",{className:"btn sm",disabled:!r.trim()||n.isPending,onClick:l,children:"Allow"})]}),t.jsx(X,{text:`squad config set hosts ${[...e,r.trim()].filter(Boolean).join(" ")||"nexus.example.com"}`})]})]})}function kB(){const e=re(),s=Ml().data?.guard,[r,i]=N.useState(""),[a,l]=N.useState("");if(!s?.on)return null;const c=(h,m,p)=>e.mutate({path:"/api/v1/settings",method:"PUT",body:{guard:{allowRead:s.allowRead,allowWrite:s.allowWrite,...h}},done:m},{onSuccess:p}),u=(h,m,p,x)=>{const g=h==="read"?"allowRead":"allowWrite",j=()=>p.trim()&&!e.isPending&&c({[g]:[...m,p.trim()]},`The project's commands may ${h} ${p.trim()}`,()=>x("")),k=b=>c({[g]:m.filter(w=>w!==b)},`No longer allowed to ${h} ${b}`,()=>{});return t.jsxs("div",{className:"maprow",children:[t.jsx("b",{style:{paddingTop:4},children:h==="read"?"Also read":"Also write"}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:8,minWidth:0},children:[t.jsxs("span",{className:"note",children:[h==="read"?"Files or folders the project needs to read":"Folders the project needs to write in"," outside its copy, such as"," ",t.jsx("span",{className:"mono",children:"~/shared"}),". Add one only when a check stopped because squad-kit blocked a file the project truly needs."]}),m.length>0&&t.jsx("span",{className:"pills",children:m.map(b=>t.jsxs("span",{className:"pill mono",children:[b,t.jsx("button",{className:"linkbtn","aria-label":`Stop allowing ${b}`,title:`Stop allowing ${b}`,disabled:e.isPending,onClick:()=>k(b),children:t.jsx(Ue,{size:12})})]},b))}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("input",{className:"input mono",style:{fontSize:13,flex:"1 1 200px",minWidth:0},value:p,placeholder:"~/shared","aria-label":`A path to ${h}`,onChange:b=>x(b.target.value),onKeyDown:b=>b.key==="Enter"&&j()}),t.jsx("button",{className:"btn sm",disabled:!p.trim()||e.isPending,onClick:j,children:"Allow"})]}),t.jsx(X,{text:`squad config set allow-${h} ${[...m,p.trim()].filter(Boolean).join(" ")||"~/shared"}`})]})]})};return t.jsxs(t.Fragment,{children:[u("read",s.allowRead,r,i),u("write",s.allowWrite,a,l)]})}const M5=e=>e==="."?"The project folder":e??"";function vB(e){return{name:e.name,shared:!!e.shared,repo:e.repo??"",folder:e.folder??"",url:e.url??"",needs:e.needs,off:!!e.off}}function O5({form:e,set:n,others:s,repos:r,isNew:i}){return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"maprow part-f",children:[t.jsx("b",{children:"Name"}),t.jsx("input",{className:"input","aria-label":"Name",dir:je(e.name),value:e.name,placeholder:"Web app",onChange:a=>n({...e,name:a.target.value})})]}),i&&t.jsxs("div",{className:"maprow part-f",children:[t.jsx("b",{children:"Kind"}),t.jsxs("div",{className:"seg",style:{justifySelf:"start"},children:[t.jsx("button",{className:e.shared?"":"on",onClick:()=>n({...e,shared:!1}),children:"A part that runs by itself"}),t.jsx("button",{className:e.shared?"on":"",onClick:()=>n({...e,shared:!0}),children:"A service the parts share"})]})]}),!e.shared&&t.jsxs("div",{className:"maprow part-f",children:[t.jsx("b",{children:"Where"}),t.jsxs("div",{className:"part-where",children:[t.jsxs("select",{className:"input mono","aria-label":"Repo",value:e.repo,onChange:a=>n({...e,repo:a.target.value}),children:[!e.repo&&t.jsx("option",{value:"",children:"Pick a repo"}),r.map(a=>t.jsx("option",{value:a,children:M5(a)},a))]}),t.jsx("input",{className:"input mono","aria-label":"Folder inside the repo",value:e.folder,placeholder:"Folder inside it, if any",onChange:a=>n({...e,folder:a.target.value})})]})]}),t.jsxs("div",{className:"maprow part-f",children:[t.jsx("b",{children:"Address"}),t.jsx("input",{className:"input mono","aria-label":"Address",value:e.url,placeholder:"http://localhost:5180",onChange:a=>n({...e,url:a.target.value})})]}),t.jsxs("div",{className:"maprow part-f",children:[t.jsx("b",{children:"Cannot run without"}),t.jsxs("div",{className:"part-needs",children:[s.length===0&&t.jsx("span",{className:"note",children:"Nothing else yet."}),s.map(a=>t.jsxs("label",{children:[t.jsx("input",{type:"checkbox",checked:e.needs.includes(a.id),onChange:l=>n({...e,needs:l.target.checked?[...e.needs,a.id]:e.needs.filter(c=>c!==a.id)})}),a.name]},a.id))]})]}),!i&&t.jsxs("div",{className:"maprow part-f",children:[t.jsx("b",{children:"Not used"}),t.jsxs("label",{className:"part-off",children:[t.jsx("input",{type:"checkbox",checked:e.off,onChange:a=>n({...e,off:a.target.checked})}),"No story starts it, like an old app or another product in this folder"]})]})]})}function bB({part:e,view:n}){const s=re(),[r,i]=N.useState(null),a=n.parts.filter(h=>h.id!==e.id&&(!h.off||e.needs.includes(h.id))),l=e.needs.map(h=>n.parts.find(m=>m.id===h)?.name??h),c=e.shared?"Shared by the parts":[M5(e.repo),e.folder].filter(Boolean).join(" / "),u=()=>s.mutate({path:`/api/v1/parts/${encodeURIComponent(e.id)}`,method:"PUT",body:r,done:`Saved ${r.name}`},{onSuccess:()=>i(null)});return t.jsxs("div",{className:`part-row ${e.off?"off":""}`,children:[t.jsxs("div",{className:"part-head",children:[t.jsxs("div",{className:"grow",children:[t.jsx(R,{as:"b",text:e.name}),e.off&&t.jsx("span",{className:"pill sm",style:{marginLeft:8},children:"Not used"}),e.noRun&&!e.off&&t.jsx("span",{className:"pill sm",style:{marginLeft:8},children:"Nothing starts here"}),t.jsx("div",{className:"note",children:[c,e.url,l.length>0?`Needs ${l.join(", ")}`:""].filter(Boolean).join(" · ")})]}),!r&&t.jsx("button",{className:"btn sm",onClick:()=>i(vB(e)),children:"Correct"})]}),r&&t.jsxs("div",{className:"part-form",children:[t.jsx(O5,{form:r,set:i,others:a,repos:n.repos,isNew:!1}),t.jsxs("div",{className:"part-acts",children:[t.jsx("button",{className:"btn pri sm",disabled:s.isPending,onClick:u,children:"Save"}),t.jsx("button",{className:"btn sm",onClick:()=>i(null),children:"Cancel"}),t.jsx("span",{className:"grow"}),e.byHand&&t.jsx("button",{className:"btn sm",disabled:s.isPending,onClick:()=>s.mutate({path:`/api/v1/parts/${encodeURIComponent(e.id)}/remove`,done:`Took out ${e.name}`},{onSuccess:()=>i(null)}),children:"Take it out"})]})]})]})}function wB({view:e}){const n=re(),s={name:"",shared:!1,repo:e.repos.length===1?e.repos[0]:"",folder:"",url:"",needs:[],off:!1},[r,i]=N.useState(null);return r?t.jsx("div",{className:"part-row",children:t.jsxs("div",{className:"part-form",children:[t.jsx(O5,{form:r,set:i,others:e.parts.filter(a=>!a.off),repos:e.repos,isNew:!0}),t.jsxs("div",{className:"part-acts",children:[t.jsx("button",{className:"btn pri sm",disabled:n.isPending,onClick:()=>n.mutate({path:"/api/v1/parts",body:r,done:`Added ${r.name}`},{onSuccess:()=>i(null)}),children:"Add it"}),t.jsx("button",{className:"btn sm",onClick:()=>i(null),children:"Cancel"})]})]})}):t.jsx("button",{className:"btn sm",onClick:()=>i(s),children:"Add a part"})}function NB(){const e=De(),n=re(),s=e.data?.ready?e.data.meta.atOnce:void 0,r=i=>n.mutate({path:"/api/v1/settings",method:"PUT",body:{atOnce:i},done:i?`${i===1?"One story":`${i} stories`} of this project run at once`:"This project follows the limit every project shares"});return t.jsxs("div",{className:"maprow part-f",style:{marginTop:10},children:[t.jsx("b",{children:"Stories at once"}),t.jsxs("div",{className:"seg",style:{justifySelf:"start"},children:[t.jsx("button",{className:s===void 0?"on":"",onClick:()=>r(null),children:"As for all projects"}),[1,2,3].map(i=>t.jsx("button",{className:s===i?"on":"",onClick:()=>r(i),children:i},i))]})]})}function SB(){const e=De(),n=re(),s=e.data?.ready?e.data.meta.delivery:void 0,r=(i,a)=>n.mutate({path:"/api/v1/settings",method:"PUT",body:{delivery:i},done:a});return t.jsxs("div",{className:"maprow part-f",children:[t.jsx("b",{children:"How work goes out"}),t.jsxs("div",{className:"seg",style:{justifySelf:"start"},children:[t.jsx("button",{className:s===void 0?"on":"",onClick:()=>r(null,"Finished work goes out by pull request when a code host is signed in"),children:"Pull request if signed in"}),t.jsx("button",{className:s==="push"?"on":"",onClick:()=>r("push","Finished work goes out pushed to the branch, as one plain commit per story"),children:"Push, one plain commit"})]})]})}function CB(){const n=ve({queryKey:["parts"],queryFn:()=>ye("/api/v1/parts")}).data;return n?.several?t.jsxs("div",{style:{marginBottom:26},children:[t.jsx("h2",{style:{marginTop:6},children:"What the product is made of"}),t.jsx("p",{className:"note",style:{margin:"2px 0 10px"},children:"For engineers. The Architect found these when it read the project, and a new read keeps what you correct here. A story only starts the parts it needs."}),n.parts.map(s=>t.jsx(bB,{part:s,view:n},s.id)),t.jsxs("div",{className:"part-add",children:[t.jsx(wB,{view:n}),t.jsx(X,{text:"squad parts"})]}),t.jsx(NB,{}),t.jsx(SB,{})]}):null}const Bo="/api/v1/project-files";function _5({f:e,many:n,children:s}){const r=re();return t.jsx("div",{className:"part-row",children:t.jsxs("div",{className:"part-head",children:[t.jsxs("div",{className:"grow",children:[t.jsx("b",{className:"mono",style:{fontSize:13},children:n?`${e.repo}/${e.path}`:e.path}),s]}),t.jsx("button",{className:"btn sm",disabled:r.isPending,onClick:()=>r.mutate({path:`${Bo}/remove`,body:e,done:`${e.path} is off the list`}),children:"Take it off"})]})})}function $B({f:e,many:n}){const s=re();return t.jsxs(_5,{f:e,many:n,children:[e.ready?t.jsx("span",{className:"pill ok sm",style:{marginLeft:8},children:"Ready"}):t.jsx("span",{className:"pill you sm",style:{marginLeft:8},children:"No values for stories yet"}),t.jsxs("div",{className:"note",children:[e.ready?"Stories use the file at ":"Stories need their own values, in a file at ",t.jsx("span",{className:"mono",children:e.storyFile})]}),!e.ready&&e.inFolder&&t.jsx("button",{className:"linkbtn",style:{marginTop:4},disabled:s.isPending,onClick:()=>s.mutate({path:`${Bo}/use-mine`,body:e,done:"Copied. Change any real values in it to test values"}),children:"Start from the one in my folder"})]})}function TB(){const e=ve({queryKey:["project-files"],queryFn:()=>ye(Bo)}),n=re(),[s,r]=N.useState(""),[i,a]=N.useState(""),l=e.data;if(!l)return null;const c=l.repos.length>1,u={repo:i||(c?"":l.repos[0]),path:s},h=m=>n.mutate({path:`${Bo}/${m}`,body:u,done:`Added ${s}`},{onSuccess:()=>r("")});return t.jsxs("div",{style:{marginBottom:26},children:[t.jsx("h2",{style:{marginTop:6},children:"Files agents may not touch"}),t.jsxs("p",{className:"note",style:{margin:"2px 0 10px"},children:["For engineers. ",t.jsx("b",{children:"Local files"})," are files git does not carry, like .env.dev. squad-kit puts them in each story's copy for the project's own tests and app, and no agent can read them. A test could still read and send what is in them, so give stories local test values, never real ones. ",t.jsx("b",{children:"Locked files"})," are in git: agents can read them and never change them."]}),l.local.map(m=>t.jsx($B,{f:m,many:c},`${m.repo}/${m.path}`)),l.locked.map(m=>t.jsx(_5,{f:m,many:c,children:t.jsx("span",{className:"pill sm",style:{marginLeft:8},children:"Locked"})},`${m.repo}/${m.path}`)),t.jsxs("div",{className:"part-file-add",children:[c&&t.jsxs("select",{className:"input mono","aria-label":"Repo",value:i,onChange:m=>a(m.target.value),children:[t.jsx("option",{value:"",children:"Pick a repo"}),l.repos.map(m=>t.jsx("option",{value:m,children:m},m))]}),t.jsx("input",{className:"input mono","aria-label":"File",value:s,placeholder:".env.dev",onChange:m=>r(m.target.value)}),t.jsx("button",{className:"btn sm",disabled:!s.trim()||n.isPending,onClick:()=>h("local"),children:"Add as local"}),t.jsx("button",{className:"btn sm",disabled:!s.trim()||n.isPending,onClick:()=>h("locked"),children:"Lock it"})]}),t.jsxs("div",{className:"part-add",children:[l.docker.length>0?t.jsxs("button",{className:"btn sm",disabled:n.isPending,onClick:()=>n.mutate({path:`${Bo}/lock-docker`,done:"Locked the Docker files"}),children:["Lock ",l.docker.length===1?"the Docker file":`the ${l.docker.length} Docker files`]}):t.jsx("span",{}),t.jsx(X,{text:"squad files"})]})]})}const oi="/api/v1/database";function D5(){return ve({queryKey:["database"],queryFn:()=>ye(oi),refetchInterval:e=>e.state.data?.making?3e3:3e4})}function EB(e){return e<1024*1024?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/1024/1024).toFixed(1)} MB`}function AB(e){return e.key&&e.file?`${e.key} in ${e.file}${e.env?` (or ${e.env})`:""}`:e.env?`${e.env}${e.file?` in ${e.file}`:""}`:"Not known yet"}function PB({v:e,done:n}){const s=re(),[r,i]=N.useState({kind:e.kind,name:"",env:"",file:"",key:"",address:""}),a=c=>u=>i({...r,[c]:u.target.value}),l=Object.fromEntries(Object.entries(r).filter(([c,u])=>u.trim()&&(c!=="kind"||u!==e.kind)));return t.jsxs("div",{className:"part-file-add",style:{flexWrap:"wrap"},children:[t.jsx("select",{className:"input mono","aria-label":"Kind",value:r.kind,onChange:a("kind"),children:["postgres","mysql","mongo","sqlite"].map(c=>t.jsx("option",{value:c,children:c},c))}),t.jsx("input",{className:"input mono","aria-label":"Name",value:r.name,placeholder:e.name??"name",onChange:a("name")}),t.jsx("input",{className:"input mono","aria-label":"Setting name",value:r.env,placeholder:e.setting.env??"DATABASE_URL",onChange:a("env")}),t.jsx("input",{className:"input mono","aria-label":"Settings file",value:r.file,placeholder:e.setting.file??".env",onChange:a("file")}),t.jsx("input",{className:"input mono","aria-label":"Key in the file",value:r.key,placeholder:e.setting.key??"key in the file",onChange:a("key")}),t.jsx("input",{className:"input mono",type:"password",autoComplete:"off","aria-label":"Address",value:r.address,placeholder:"Address your copy uses",onChange:a("address")}),t.jsx("button",{className:"btn sm pri",disabled:s.isPending,onClick:()=>s.mutate({path:`${oi}/confirm`,body:l,done:"Confirmed"},{onSuccess:n}),children:"Confirm these"})]})}function Ak({redis:e}){return t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Redis"}),t.jsxs("span",{children:[t.jsx("span",{className:"mono",style:{fontSize:13},children:e.server}),t.jsx("span",{className:"note",style:{display:"block"},children:e.words}),e.stories.length>0&&t.jsx("span",{className:"note",style:{display:"block"},children:e.stories.map(n=>`${n.story}: ${n.number}`).join(" · ")})]})]})}function B5(){const e=D5(),n=re(),[s,r]=N.useState(!1),[i,a]=N.useState(""),l=e.data;if(!l?.words)return null;const c=l.database,u=t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>n.mutate({path:`${oi}/find`,done:"Looked again"}),children:"Find it again"});if(!c)return t.jsxs("div",{children:[t.jsxs("span",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("span",{className:"note",children:l.words}),u,t.jsx(X,{text:"squad db"})]}),l.redis&&t.jsx(Ak,{redis:l.redis})]});const h=l.template?.tables.filter(m=>m.kept==="sampled").length??0;return t.jsxs("div",{children:[t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Database"}),t.jsxs("span",{children:[c.kindName,c.name?t.jsxs("span",{className:"mono",children:[" ",c.name]}):null,c.confirmed?t.jsxs("span",{className:"pill ok sm",style:{marginLeft:8},children:["Confirmed by ",c.confirmed.by]}):t.jsx("span",{className:"pill you sm",style:{marginLeft:8},children:"Not confirmed yet"}),c.where&&t.jsx("span",{className:"note",style:{display:"block"},children:c.where}),c.from?.length?t.jsxs("span",{className:"note",style:{display:"block"},children:["Learned from ",t.jsx("span",{className:"mono",children:c.from.join(", ")})]}):null]})]}),l.redis&&t.jsx(Ak,{redis:l.redis}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Setting"}),t.jsx("span",{className:"mono",style:{fontSize:13},children:AB(c.setting)})]}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Address"}),t.jsxs("span",{children:[t.jsx("span",{className:"mono",style:{fontSize:13},children:c.address??"Not known yet"}),c.secret&&t.jsx("span",{className:"note",children:" · kept on this computer only"})]})]}),t.jsxs("div",{style:{display:"flex",gap:8,margin:"10px 0",flexWrap:"wrap",alignItems:"center"},children:[!c.confirmed&&t.jsx("button",{className:"btn sm pri",disabled:n.isPending,onClick:()=>n.mutate({path:`${oi}/confirm`,done:"Confirmed"}),children:"Confirm it"}),t.jsx("button",{className:"btn sm",onClick:()=>r(!s),children:s?"Close":"Correct it"}),u,t.jsx("span",{className:"grow"}),t.jsx(X,{text:"squad db confirm"})]}),s&&t.jsx(PB,{v:c,done:()=>r(!1)}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Template"}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:6},children:[l.making?t.jsxs("span",{className:"note",children:["Being made, since ",st(l.making.since),". It only reads your database."]}):l.template?t.jsxs("span",{children:[EB(l.template.bytes),", made ",st(l.template.madeAt)," · ",l.template.tables.length," tables",h?`, ${h} sampled`:"",l.template.hidePersonal?", personal data hidden":""]}):t.jsx("span",{className:"note",children:"None yet. Stories use the database as before until there is one."}),l.failed&&!l.making&&t.jsxs("span",{className:"note",children:["The last one was not made: ",l.failed.text]}),l.missing.length>0&&t.jsxs("span",{className:"note",children:["This computer has no ",l.missing.join(", "),"."]}),l.blocked&&t.jsx("span",{className:"note",children:l.blocked}),t.jsxs("span",{style:{display:"flex",gap:8,alignItems:"center"},children:[t.jsx("button",{className:"btn sm",disabled:n.isPending||!!l.making||!c.confirmed,onClick:()=>n.mutate({path:`${oi}/template`,done:"Making the template"}),children:l.template?"Make it again":"Make the template"}),t.jsx(X,{text:"squad db template"})]})]})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Hide personal data"}),t.jsxs("span",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:`btn sm ${c.hidePersonal?"pri":""}`,"aria-pressed":!!c.hidePersonal,disabled:n.isPending,onClick:()=>n.mutate({path:oi,method:"PUT",body:{hidePersonal:!c.hidePersonal},done:c.hidePersonal?"Off, from the next template":"On, from the next template"}),children:c.hidePersonal?"On":"Off"}),t.jsx("span",{className:"note",children:"Names, ID numbers, phones, emails and addresses become fake in the template."}),t.jsx(X,{text:`squad config set db-hide ${c.hidePersonal?"off":"on"}`})]})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Sample size"}),t.jsxs("span",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("input",{className:"input mono",style:{width:110},"aria-label":"Rows",inputMode:"numeric",value:i,placeholder:String(c.sampleRows??1e3),onChange:m=>a(m.target.value)}),t.jsx("button",{className:"btn sm",disabled:!i.trim()||n.isPending,onClick:()=>n.mutate({path:oi,method:"PUT",body:{sampleRows:Number(i)},done:"Saved, from the next template"},{onSuccess:()=>a("")}),children:"Save"}),t.jsx("span",{className:"note",children:"rows of each big table, the newest. Small tables are kept whole."})]})]}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Story databases now"}),t.jsx("span",{children:l.stories.length?l.stories.map(m=>t.jsxs("span",{style:{display:"block"},children:[t.jsx("b",{children:m.story})," ",t.jsx("span",{className:"mono",style:{fontSize:13},children:m.name})," ",t.jsx("span",{className:"note",children:st(m.at)})]},m.story)):t.jsx("span",{className:"note",children:"None"})})]}),l.notes.length>0&&t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Notes"}),t.jsx("span",{children:l.notes.slice(0,5).map(m=>t.jsxs("span",{className:"note",style:{display:"block"},children:[st(m.at),": ",m.text]},`${m.at}${m.text}`))})]})]})}function RB(){const e=D5().data;return e?.words?t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:6},children:[t.jsx("span",{className:"note",children:e.words}),t.jsxs("details",{children:[t.jsx("summary",{className:"note",children:"For engineers"}),t.jsx("div",{style:{marginTop:6},children:t.jsx(B5,{})})]})]}):null}function qB(){return t.jsxs("div",{style:{marginBottom:26},children:[t.jsx("h2",{style:{marginTop:6},children:"Each story's own database"}),t.jsx("p",{className:"note",style:{margin:"2px 0 10px"},children:"For engineers. squad-kit learns the project's database from its files. Once you confirm it and make a template, each story gets its own copy of the database on the same server, and its copy of the code points at it. It goes when the story is merged, released or deleted. Your own database is only read, to make the template."}),t.jsx(B5,{})]})}function IB(e,n=400){const[s,r]=N.useState(e),i=JSON.stringify(e);return N.useEffect(()=>{const a=setTimeout(()=>r(e),n);return()=>clearTimeout(a)},[i,n]),s}const Bf=(e,n)=>!e.when||e.when.is.includes(n[e.when.key]??"");function FB(e,n){if(e.fields.some(i=>i.secret))return"squad config set tracker";const r=e.fields.filter(i=>Bf(i,n)&&n[i.key]).map(i=>`${i.key}=${n[i.key]}`).map(i=>/^[\w@%+=:,./-]+$/.test(i)?i:`'${i.replace(/'/g,"'\\''")}'`);return`squad config set tracker --type ${e.module}${r.length?` --field ${r.join(" ")}`:""}`}function LB(){const e=re(),[n,s]=N.useState(null),r=ve({queryKey:n?["tracker",n]:["tracker"],queryFn:()=>ye(`/api/v1/tracker${n?`?module=${encodeURIComponent(n)}`:""}`),refetchInterval:6e4}),[i,a]=N.useState(null),l=r.data,c=i??l?.values??{},u=IB(Object.fromEntries((l?.fields??[]).filter(b=>!b.secret).map(b=>[b.key,c[b.key]??""]))),h=!!l?.fields.some(b=>b.choice&&Bf(b,u)),m=ve({queryKey:["tracker-choices",l?.module,u],queryFn:()=>ye(`/api/v1/tracker/choices?${new URLSearchParams({module:l.module,...u}).toString()}`),enabled:!!(l&&h),placeholderData:b=>b});if(!l)return null;const p=(b,w)=>a({...c,[b]:w}),x=l.type===l.module,g=l.fields.some(b=>b.secret),j=l.fields.filter(b=>Bf(b,c)),k=b=>t.jsx(MB,{f:b,value:c[b.key]??"",hasToken:l.hasToken,list:m.data?.lists[b.key],asked:!!m.data,onChange:w=>p(b.key,w)},b.key);return t.jsxs("div",{id:"tracker",style:{marginBottom:26},children:[t.jsx("h2",{style:{marginTop:6},children:l.label??"Tracker"}),l.about&&t.jsx("p",{className:"note",style:{margin:"2px 0 10px"},children:l.about}),l.modules.length>1&&t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Tracker"}),t.jsx("span",{className:"seg",role:"radiogroup","aria-label":"Tracker",style:{width:"fit-content"},children:l.modules.map(b=>t.jsx("button",{role:"radio","aria-checked":l.module===b.name,className:l.module===b.name?"on":"",onClick:()=>{s(b.name),a(null)},children:b.label},b.name))})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Status"}),t.jsx("span",{children:x&&l.user?t.jsxs("span",{className:"pill ok",children:["Connected as ",l.user]}):x?t.jsx("span",{className:"pill bug",children:l.error??(g?l.hasToken?"Not connected":"Needs a token":"Not connected")}):t.jsx("span",{className:"pill wait",children:"Not set up"})})]}),l.note&&t.jsx("p",{className:"note",role:"note",style:{margin:"6px 0"},children:l.note}),l.steps.length>0&&t.jsx(zB,{steps:l.steps}),j.filter(b=>!b.more).map(k),j.some(b=>b.more)&&t.jsxs("details",{style:{margin:"6px 0"},children:[t.jsx("summary",{className:"note",style:{cursor:"pointer"},children:"More"}),j.filter(b=>b.more).map(k)]}),m.data?.error&&!l.steps.length&&t.jsx("p",{className:"note",role:"alert",style:{color:"var(--bug)",margin:"6px 0"},children:m.data.error}),t.jsxs("div",{style:{marginTop:12,display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:"btn pri sm",disabled:!i&&x||e.isPending,onClick:()=>e.mutate({path:"/api/v1/tracker",method:"PUT",body:{...c,module:l.module},done:`${l.label??"The tracker"} is connected`},{onSuccess:()=>{a(null),s(null)}}),children:e.isPending?"Checking…":"Save and check"}),l.hint&&t.jsx("span",{className:"note",children:l.hint}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:FB(l,c)})]})]})}function zB({steps:e}){return t.jsxs("div",{className:"maprow",role:"note","aria-label":"Before it can connect",children:[t.jsx("b",{children:"First"}),t.jsx("span",{style:{display:"grid",gap:6},children:e.map((n,s)=>t.jsxs("span",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[t.jsxs("span",{children:[s+1,". ",n.say]}),n.command&&t.jsx(X,{text:n.command,always:!0}),n.link&&t.jsx("a",{href:n.link,target:"_blank",rel:"noreferrer",style:{fontWeight:600},children:n.link.replace(/^https:\/\//,"")})]},n.say))})]})}function MB({f:e,value:n,hasToken:s,list:r,asked:i,onChange:a}){const l={className:"input mono",style:{fontSize:13}};let c;if(e.options)c=t.jsx("span",{className:"seg",role:"radiogroup","aria-label":e.label,style:{width:"fit-content"},children:e.options.map(u=>t.jsx("button",{role:"radio","aria-checked":n===u.value,className:n===u.value?"on":"",onClick:()=>a(u.value),children:u.label},u.value))});else if(e.choice&&e.typed)c=t.jsxs(t.Fragment,{children:[t.jsx("input",{...l,"aria-label":e.label,list:`tracker-${e.key}`,value:n,placeholder:e.placeholder,onChange:u=>a(u.target.value)}),t.jsx("datalist",{id:`tracker-${e.key}`,children:(r??[]).map(u=>t.jsx("option",{value:u.value,children:u.label},u.value))})]});else if(e.choice){const u=r??(n?[{value:n,label:n}]:[]);c=t.jsxs("select",{className:"input",style:{fontSize:13},"aria-label":e.label,value:n,onChange:h=>a(h.target.value),children:[!u.some(h=>h.value==="")&&t.jsx("option",{value:"",children:r||i?"Pick one":"Loading…"}),u.map(h=>t.jsx("option",{value:h.value,children:h.label},h.value))]})}else c=t.jsx("input",{...l,"aria-label":e.label,type:e.secret?"password":"text",autoComplete:"off",value:n,placeholder:e.secret&&s?"Saved. Paste a new one to replace it":e.placeholder,onChange:u=>a(u.target.value)});return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:e.label}),c]})}function OB(){const e=De(),n=e.data?.ready?e.data.tickets.filter(ju):[],s=gg();return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Waiting for you"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:"squad inbox"})]}),t.jsx("div",{className:"scroll",children:t.jsx("div",{className:"page",children:e.isError&&!e.data?t.jsx(ys,{what:"what waits for you",error:e.error,onRetry:()=>void e.refetch()}):n.length+s.length===0?t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:t.jsx(ce,{size:18,strokeWidth:2.5})}),t.jsxs("div",{children:[t.jsx("b",{children:"Nothing needs you right now"}),t.jsx("span",{children:"The squad is working. Questions, plans, proof and decisions land here."})]})]}):t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.map(r=>t.jsx(y4,{w:r},r.id)),n.map(r=>t.jsxs("div",{className:"wcard",style:{padding:"16px 18px 16px 22px"},children:[t.jsxs("div",{className:"grow",children:[t.jsxs("div",{className:"meta",children:[t.jsx("span",{className:"id",children:r.id}),t.jsx(j4,{t:r}),t.jsx("span",{children:er[r.stage]}),t.jsx("span",{children:st(r.activity[0]?.at??r.createdAt)})]}),t.jsx(R,{as:"h3",text:r.title}),t.jsx(R,{as:"p",text:pg(r)&&r.agentQuestion?`“${r.agentQuestion.text}”`:r.waiting?.summary??(Xs(r)?`Change ${Si(r).id} to the spec waits for you`:Rs(r)?j1(r):r.outdated?.length?x1(r):`Looks stuck: ${r.quiet?.detail??"no progress"}`)})]}),t.jsx(X,{text:!r.waiting&&Xs(r)?`squad propose ${r.id} --approve`:!r.waiting&&Rs(r)?`squad test-command ${r.id} --use`:g1(r)}),t.jsx(Sg,{t:r,problem:r.waiting?.kind==="stuck"?"error":!r.waiting&&r.quiet?r.quiet.kind==="long"?"slow":"stuck":"waiting",className:"btn sm"}),r.waiting?.kind==="proof"?t.jsx(ge,{to:"/tickets/$id/proof",params:{id:r.id},className:"btn pri sm",children:zd(r)}):t.jsx(ge,{to:"/board",search:{ticket:r.id},className:"btn pri sm",children:r.waiting?zd(r):Xs(r)?"Check the change":"Check it"})]},r.id))]})})})]})}function _B(){const e=De(),[n,s]=N.useState(!1),r=e.data?.ready?e.data.tickets.filter(i=>i.kind==="bug"):[];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Bugs"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:'squad bug "What happened"'}),t.jsxs("button",{className:"btn pri",onClick:()=>s(!0),children:[t.jsx(Js,{size:15})," Report a bug"]})]}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page",children:[t.jsx("p",{className:"note",style:{marginBottom:12},children:"Each bug is a ticket linked to the release it was found in. It goes around the same loop, and the Tester adds a check so it can't come back."}),r.length===0?t.jsx("p",{className:"note",children:"No open bugs."}):t.jsxs("table",{className:"table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{style:{width:90},children:"ID"}),t.jsx("th",{children:"What happened"}),t.jsx("th",{style:{width:120},children:"Found in"}),t.jsx("th",{style:{width:120},children:"Stage"}),t.jsx("th",{style:{width:240},children:"Now"})]})}),t.jsx("tbody",{children:r.map(i=>t.jsxs("tr",{children:[t.jsx("td",{className:"mono",children:i.id}),t.jsx("td",{...ze(i.title),children:t.jsx(ge,{to:"/board",search:{ticket:i.id},style:{fontWeight:600},children:t.jsx(Jt,{text:i.title,dir:ze(i.title).dir})})}),t.jsx("td",{children:i.foundIn??""}),t.jsx("td",{children:er[i.stage]}),t.jsx("td",{style:{color:i.waiting?"var(--you-ink)":"var(--muted)"},...ze(i.waiting?.summary??i.status),children:t.jsx(Jt,{text:i.waiting?.summary??i.status,dir:ze(i.waiting?.summary??i.status).dir})})]},i.id))})]})]})}),n&&t.jsx(hg,{onClose:()=>s(!1)})]})}const DB=[{key:"setup",label:"Set up",hint:"Installs what the project needs, e.g. npm install"},{key:"test",label:"Test",hint:"Runs the tests, e.g. npm test"},{key:"lint",label:"Lint",hint:"Checks code style, e.g. npm run lint"},{key:"build",label:"Build",hint:"Builds the project, e.g. npm run build"},{key:"start",label:"Start",hint:"Runs the app for screenshots, e.g. npm start"},{key:"url",label:"App address",hint:"Where the app opens, e.g. http://localhost:3000"},{key:"envFile",label:"Env file",hint:"Settings the app reads on this computer, e.g. .env.dev"},{key:"deploy",label:"After a release",hint:"Runs after a release, e.g. az pipelines run …"}];function BB(){const e=De(),n=e.data?.ready?e.data.meta:void 0;if(!n)return null;const s=n.repos?.length?n.repos:[{path:".",base:n.git?.base??"main",remote:n.git?.remote??"",commands:n.commands??{}}],r=!!n.repos?.length;return t.jsxs(t.Fragment,{children:[t.jsx(CB,{}),t.jsx(TB,{}),n.engine==="live"&&t.jsx(qB,{}),t.jsx("h2",{style:{marginTop:6},children:"How the squad checks and runs this project"}),t.jsxs("p",{className:"note",style:{margin:"2px 0 10px"},children:["The Architect filled these in when it read the project. squad-kit runs Test, Lint and Build itself before anything ships.",r&&" This project has several code folders; each ticket works in one of them."]}),t.jsx(ZB,{always:!!n.alwaysNewTests}),t.jsx(XB,{phone:n.phone}),s.map(i=>t.jsx(WB,{repo:i,multi:r},i.path)),t.jsx(JB,{})]})}function WB({repo:e,multi:n}){const s=re(),[r,i]=N.useState(null),[a,l]=N.useState(null),c=r??e.commands,u=a??{base:e.base,remote:e.remote},h=()=>{const m=n?{repos:[{path:e.path,...u,commands:c}]}:{commands:c,git:u};s.mutate({path:"/api/v1/settings",method:"PUT",body:m,done:"Settings saved"},{onSuccess:()=>{i(null),l(null)}})};return t.jsxs("div",{style:{marginBottom:24},children:[n&&t.jsxs("h3",{className:"mono",style:{fontSize:14,margin:"18px 0 2px"},children:[e.path,e.summary&&t.jsx(R,{className:"note",style:{fontFamily:"inherit",marginLeft:8},text:e.summary})]}),DB.map(m=>{const p=t.jsx("input",{className:"input mono",style:{fontSize:13},value:c[m.key]??"",placeholder:m.hint,onChange:x=>i({...c,[m.key]:x.target.value})});return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:m.label}),m.key==="start"?t.jsxs("div",{children:[p,t.jsx(HB,{repo:e.path,command:c.start})]}):m.key==="envFile"?t.jsxs("div",{children:[p,t.jsx(UB,{repo:n?e.path:void 0,file:c.envFile})]}):p]},m.key)}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Release branch"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:u.base,onChange:m=>l({...u,base:m.target.value})})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Push to"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:u.remote,placeholder:"origin (empty: no push)",onChange:m=>l({...u,remote:m.target.value})})]}),t.jsx("div",{style:{marginTop:12},children:t.jsxs("button",{className:"btn pri sm",disabled:!r&&!a,onClick:h,children:["Save",n?` ${e.path}`:""]})})]})}function UB({repo:e,file:n}){return t.jsxs("p",{className:"note",style:{margin:"6px 0 0",display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("span",{children:"squad-kit gives its values to every command it runs for this part on this computer, then its own database, Redis and port on top. A file git does not carry needs values for stories: add it under Local files."}),t.jsx(X,{text:`squad config set env-file ${n?.trim()||".env.dev"}${e?` --repo ${e}`:""}`})]})}function HB({repo:e,command:n}){const s=n?.trim()??"",[r,i]=N.useState(s);N.useEffect(()=>{const c=setTimeout(()=>i(s),300);return()=>clearTimeout(c)},[s]);const a=ve({queryKey:["start-note",e,r],queryFn:()=>ye(`/api/v1/settings/start?repo=${encodeURIComponent(e)}&command=${encodeURIComponent(r)}`),enabled:!!r,placeholderData:c=>c}),l=s&&r?a.data?.note:null;return l?t.jsx("p",{className:"note",style:{margin:"6px 0 0"},children:l}):null}function KB(){const e=re(),n=ve({queryKey:["speech"],queryFn:()=>ye("/api/v1/speech")}),[s,r]=N.useState(""),i=n.data?.hasKey,a=n.data?.video!==!1,l=(c,u)=>e.mutate({path:"/api/v1/speech",method:"PUT",body:c,done:h=>h.unchecked?"Saved. squad-kit could not reach Munsit to check the key, so it finds out with the first note.":u},{onSuccess:()=>{r(""),n.refetch()}});return t.jsxs("div",{style:{marginBottom:26},children:[t.jsx("h2",{style:{marginTop:6},children:"Speech to text"}),t.jsxs("p",{className:"note",style:{margin:"2px 0 10px"},children:[a?"Agents cannot listen. With a Munsit key, squad-kit writes out every voice and video note you attach, in Arabic or English, and takes pictures of the screen in videos.":"Agents cannot listen. With a Munsit key, squad-kit writes out every voice note you attach, in Arabic or English. Video notes need a Mac: on this computer they stay attached, and nobody hears them."," ","Without a key, notes stay attached but nobody hears them. Your key stays on this computer."]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Status"}),t.jsx("span",{children:i?t.jsx("span",{className:"pill ok",children:"Munsit is set up"}):t.jsx("span",{className:"pill wait",children:"Not set up"})})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Munsit key"}),t.jsx("input",{className:"input mono",style:{fontSize:13},type:"password",autoComplete:"off",value:s,placeholder:i?"Saved. Paste a new one to replace it":"API key from munsit.com",onChange:c=>r(c.target.value)})]}),t.jsxs("div",{style:{marginTop:12,display:"flex",gap:10,alignItems:"center"},children:[t.jsx("button",{className:"btn pri sm",disabled:!s.trim()||e.isPending,onClick:()=>l({munsit:s},"Munsit is set up"),children:"Save"}),i&&t.jsx("button",{className:"btn sm",disabled:e.isPending,onClick:()=>l({remove:!0},"Munsit key removed"),children:"Remove"})]})]})}function VB(){const{restarting:e,restart:n}=kb();return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Board"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:"btn sm",disabled:e,onClick:()=>void n(),children:e?"Restarting…":"Restart the board"}),t.jsx("span",{className:"note",children:"Same link. Running work picks up where it stopped."}),t.jsx(X,{text:"squad console --restart"})]})]})}function YB(){const e=De(),n=re(),s=e.data?.ready?e.data.meta:void 0;if(!s)return null;const r=s.runner??"acp",i=(a,l)=>n.mutate({path:"/api/v1/settings",method:"PUT",body:{runner:a},done:l});return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Talk to Claude"}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:`btn sm ${r==="acp"?"pri":""}`,onClick:()=>i("acp","The squad talks to Claude the usual way"),children:"The usual way"}),t.jsx("button",{className:`btn sm ${r==="direct"?"pri":""}`,onClick:()=>i("direct","The squad runs Claude Code directly"),children:"Directly"}),t.jsx("span",{className:"note",style:{marginLeft:6},children:"Leave this on The usual way. If that cannot start, a step runs Claude Code directly by itself."})]})]})}function GB(){const e=jb(),n=re(),s=e.data;return s?t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Tickets at once"}),t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[Array.from({length:s.max},(r,i)=>i+1).map(r=>t.jsx("button",{className:`btn sm ${r===s.parallel?"pri":""}`,onClick:()=>n.mutate({path:"/api/v1/app/settings",method:"PUT",body:{parallel:r},done:`Up to ${r} tickets at once, across all your projects`}),children:r},r)),t.jsx("span",{className:"note",style:{marginLeft:6},children:"How many tickets the squads work on at the same time, across all your projects. They share your AI accounts."})]})]}):null}function QB({on:e,locked:n}){const s=re();return n?t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Project documents in git"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:"btn sm",disabled:!0,children:"Off"}),t.jsx("span",{className:"note",children:n})]})]}):t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Project documents in git"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:"btn sm",onClick:()=>s.mutate({path:"/api/v1/settings",method:"PUT",body:{documentsInGit:!e},done:e?"Project documents stay out of git":"Project documents go into git with each ticket"}),children:e?"On: turn it off":"Off: turn it on"}),t.jsx("span",{className:"note",children:"On: each ticket's spec, design and decisions are committed with its code, so they reach the team through the pull request. Hand over needs it on."})]})]})}function ZB({always:e}){const n=re();return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"New tests"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("button",{className:"btn sm",onClick:()=>n.mutate({path:"/api/v1/settings",method:"PUT",body:{alwaysNewTests:!e},done:e?"Each new story can be built without new tests again":"Every new story writes new tests now"}),children:e?"Always: let each story choose":"Each story chooses: make it always"}),t.jsxs("span",{className:"note",children:[e?'Every story writes new tests, so the new story form has no "Write new tests" switch.':'The new story form has a "Write new tests" switch, on by default. Turned off, the Builder writes no new tests; the checks, the review and the proof still run.'," ","Saved in the project's settings, for the whole team."]}),t.jsx(X,{text:`squad config set new-tests ${e?"switch":"always"}`})]})]})}function XB({phone:e}){const n=re(),s=e??"auto",r=[{id:"auto",label:"Automatic"},{id:"iphone",label:"iPhone"},{id:"android",label:"Android"}];return t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Phone for pictures"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsx("span",{className:"seg",role:"radiogroup","aria-label":"Phone for pictures",children:r.map(i=>t.jsx("button",{role:"radio","aria-checked":s===i.id,className:s===i.id?"on":"",onClick:()=>s!==i.id&&n.mutate({path:"/api/v1/settings",method:"PUT",body:{phone:i.id},done:`Phone for pictures: ${i.label}`}),children:i.label},i.id))}),t.jsx("span",{className:"note",children:"For an app that builds for both iPhone and Android. Automatic uses the iPhone on a Mac when its tools are ready, else Android; a computer that is not a Mac always uses Android. Saved in the project's settings, for the whole team."}),t.jsx(X,{text:`squad config set phone ${s==="auto"?"android":s==="android"?"iphone":"auto"}`})]})]})}function JB(){const e=re();return t.jsx("div",{style:{margin:"4px 0 26px"},children:t.jsx("button",{className:"btn sm",onClick:()=>e.mutate({path:"/api/v1/scan",done:"The Architect is reading the project again"}),children:"Read the project again"})})}function eW(){const e=De(),{theme:n,toggleTheme:s,showCommands:r,toggleCommands:i}=Le(),a=re(),[l,c]=N.useState(!1),u=e.data?.ready?e.data.meta:void 0,h=e.data?.ready?e.data.self:void 0;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Settings"}),t.jsx("span",{className:"grow"}),t.jsx(ge,{to:"/connections",className:"btn sm",children:"Connections"})]}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page",style:{maxWidth:760},children:[t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Theme"}),t.jsx("span",{children:t.jsx("button",{className:"btn sm",onClick:s,children:n==="light"?"Switch to dark":"Switch to light"})})]}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Terminal commands"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center"},children:[t.jsx("button",{className:"btn sm",onClick:i,children:r?"Hide them":"Show them"}),t.jsx("span",{className:"note",children:"Every button shows the command that does the same thing."})]})]}),t.jsx(yM,{}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Project files"}),t.jsxs("span",{className:"note",children:[t.jsx("span",{className:"mono",style:{fontSize:13},children:".squad/"})," in the project folder: specs, decisions and releases, shared with the team. Live progress, chats and sign-ins stay on this computer."]})]}),u?.engine==="live"&&t.jsx(QB,{on:u.documentsInGit!==!1,...h?.docs?{locked:h.docs}:{}}),t.jsx(VB,{}),u?.engine==="live"&&t.jsx(GB,{}),u?.engine==="live"&&t.jsx(YB,{}),u?.engine==="live"&&t.jsx(kB,{}),u?.engine==="live"&&t.jsx(LB,{}),u?.engine==="live"&&t.jsx(KB,{}),u?.engine==="live"&&t.jsx(BB,{}),u?.engine==="demo"&&t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Demo board"}),t.jsxs("span",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[t.jsxs("button",{className:"btn sm danger",onClick:()=>c(!0),children:[t.jsx(gi,{size:13})," Start the demo over"]}),t.jsxs("span",{className:"note",children:["The squad plays back a recorded run at ",u.speed,"x speed."]})]})]}),u&&t.jsx(cO,{}),t.jsx("h2",{style:{marginTop:26},children:"About squad-kit"}),t.jsx(Nb,{}),t.jsx(gz,{})]})}),l&&t.jsx(Ye,{title:"Start the demo over?",onClose:()=>c(!1),footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",onClick:()=>a.mutate({path:"/api/v1/demo/reset",done:"The demo board is fresh again."},{onSuccess:()=>c(!1)}),children:[t.jsx(gi,{size:15})," Start over"]}),t.jsx("button",{className:"btn",onClick:()=>c(!1),children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:"squad demo"})]}),children:t.jsx("p",{children:"Every ticket, release and decision goes back to how the demo starts."})})]})}function Kg(e=""){const[n,s]=N.useState(e),r=ve({queryKey:["app","folders",n],queryFn:()=>ye(`/api/v1/app/folders${n?`?path=${encodeURIComponent(n)}`:""}`)});return{at:n,setAt:s,listing:r}}function tW(e){return ve({queryKey:["app","folders","look",e?.path],queryFn:()=>ye(`/api/v1/app/folders/look?path=${encodeURIComponent(e.path)}`),enabled:!!e?.canAdd,retry:!1})}function nW(e){const n=e.split("/").filter(Boolean);return[{name:"/",path:"/"},...n.map((s,r)=>({name:s,path:`/${n.slice(0,r+1).join("/")}`}))]}function Vg({at:e,go:n,listing:s,onError:r}){const[i,a]=N.useState(null),[l,c]=N.useState(!1),u=s.data,h=j=>j.replace(/[/\\][^/\\]+[/\\]?$/,"")||"/",m=u?.parent??(s.isError&&e?h(e):null),p=j=>{a(null),n(j)},x=async()=>{if(!(!u||!i?.trim()||l)){c(!0);try{const j=await et("/api/v1/app/folders","POST",{parent:u.path,name:i.trim()});p(j.path)}catch(j){r(j instanceof Error?j.message:String(j))}finally{c(!1)}}},g=u?nW(u.path):[];return t.jsxs(t.Fragment,{children:[u&&t.jsx("div",{className:"places",children:u.places.map(j=>t.jsx("button",{className:`btn sm ${j.path===u.path?"pri":""}`,onClick:()=>p(j.path),children:j.name},j.path))}),t.jsxs("div",{className:"fb",children:[t.jsxs("div",{className:"fb-bar",children:[t.jsx("button",{className:"iconbtn",disabled:!m,onClick:()=>m&&p(m),"aria-label":"Up one folder",title:"Up one folder",children:t.jsx(G9,{size:15})}),t.jsx("span",{className:"crumbs mono",children:g.map((j,k)=>t.jsxs("span",{children:[k>0&&t.jsx(hu,{size:12}),t.jsx("button",{onClick:()=>p(j.path),children:j.name})]},j.path))})]}),t.jsxs("div",{className:"fb-list",role:"list",children:[s.isError&&t.jsx("p",{className:"note bad",children:s.error.message}),u&&u.folders.length===0&&t.jsx("p",{className:"note",children:"No folders inside."}),u?.folders.map(j=>t.jsxs("button",{role:"listitem",className:"fb-row",onClick:()=>p(j.path),children:[j.kind==="project"?t.jsx(Z9,{size:16}):j.kind==="repo"?t.jsx(X9,{size:16}):t.jsx(J9,{size:16}),t.jsx("span",{className:"nm",children:j.name}),j.kind==="project"&&t.jsx("span",{className:"pill ok sm",children:"squad-kit project"}),j.kind==="repo"&&t.jsx("span",{className:"pill sm",children:"code"})]},j.path))]}),t.jsx("div",{className:"fb-new",children:i===null?t.jsxs("button",{className:"btn sm",disabled:!u,onClick:()=>a(""),children:[t.jsx(Gm,{size:14})," New folder here"]}):t.jsxs(t.Fragment,{children:[t.jsx("input",{className:"input",autoFocus:!0,dir:je(i),placeholder:"Name of the new folder",value:i,onChange:j=>a(j.target.value),onKeyDown:j=>j.key==="Enter"&&void x()}),t.jsx("button",{className:"btn sm pri",disabled:!i.trim()||l,onClick:()=>void x(),children:"Make it"}),t.jsx("button",{className:"btn sm",onClick:()=>a(null),children:"Cancel"})]})})]})]})}const iu={all:"All agents",analyst:"Analyst",architect:"Architect",builder:"Builder",reviewer:"Reviewer",tester:"Tester"},W5={checks:"With the checks",merge:"Before merge",release:"Before release"},sW={checks:"with the checks",merge:"before merge",release:"before release"},Yg="It applies from the next step of every story.",U5="On this computer it runs without the guard, as your project's own checks do.",Pk={try:"Try first",on:"On",off:"Off"},rW=/\b(commit|push|pull request|merge request|gh pr)\b/i;function iW(e){return e.kind==="rule"?`Rule, for ${e.agents?.includes("all")?"all agents":`the ${e.agents?.map(n=>iu[n]??n).join(" and ")}`}`:e.kind==="checklist"?`Checklist, for the ${iu[e.agent??"reviewer"]}`:`Gate, ${sW[e.when??"checks"]}${e.on_fail==="warn"?", warn only":""}`}function aW(e){const n=`the ${e.kind} "${es(e.name)}"`;return e.did==="added"?`added ${n}${e.from?`, from the folder ${es(e.from)}`:""}`:e.did==="removed"?`removed ${n}`:e.did==="tried"?`tried ${n} again`:e.did==="off"?`turned off ${n}`:e.did==="on"?`turned on ${n}`:`set ${n} to Try first`}const Rk=8;function oW({view:e}){const[n,s]=N.useState(!1),[r,i]=N.useState(!1),a=e.additions;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"hn-addhead",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"hn-title",children:"What your team added"}),t.jsxs("p",{className:"note",children:[a.shared?"Saved with the project. Your team gets it with your next release.":"Saved on this computer. This project keeps its board out of git, so your team does not get it."," Additions can only make the squad stricter."]})]}),t.jsxs("button",{className:"btn pri hn-big",disabled:!!a.broken,onClick:()=>s(!0),children:[t.jsx(jt,{size:16})," Add to your harness"]})]}),a.broken&&t.jsxs("div",{className:"hn-box bad",role:"alert",children:[t.jsx("b",{children:a.broken})," Until then, stories stop and ask at each check instead of going on without your team's gates."]}),!a.broken&&t.jsxs("div",{className:"hn-box",children:[t.jsx("b",{children:"Try first"})," lets a new gate or checklist run and tell you what it would have stopped, without stopping anything. Turn it on when you trust it."]}),a.items.length===0&&!a.broken&&t.jsxs("div",{className:"hn-empty",children:[t.jsx("b",{children:"Nothing added yet."}),t.jsx("p",{className:"note",children:"Your harness is fully working as it is. Add a rule, a checklist or a gate when your team needs one."}),t.jsxs("button",{className:"btn",onClick:()=>s(!0),children:[t.jsx(jt,{size:15})," Add the first one"]})]}),a.items.length>0&&t.jsx("div",{className:"hn-card",children:a.items.map(l=>t.jsx(lW,{a:l,view:e},l.id))}),t.jsxs("p",{className:"note hn-gap",children:["squad-kit's own gates aren't on this list, because they can't be turned off. ",t.jsx(ge,{className:"hn-link",to:"/harness",search:{},children:"See them on the line."})]}),a.log.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"hn-sub",children:"Who did what"}),t.jsx("ul",{className:"hn-log",children:(r?a.log:a.log.slice(0,Rk)).map((l,c)=>t.jsxs("li",{children:[t.jsx("b",{children:es(l.by)})," ",aW(l)," ",t.jsx("small",{children:st(l.at)})]},c))}),!r&&a.log.length>Rk&&t.jsxs("button",{className:"btn sm hn-gap",onClick:()=>i(!0),children:["Show all ",a.log.length]})]}),n&&t.jsx(cW,{view:e,close:()=>s(!1)})]})}function lW({a:e,view:n}){const s=re(),{toast:r}=Le(),[i,a]=N.useState(!1),[l,c]=N.useState(!1),[u,h]=N.useState(null),m=x=>s.mutate({path:`/api/v1/harness/additions/${e.id}/state`,body:{state:x},done:x==="off"?`${e.name} is off.`:`${e.name} is ${Pk[x]}. ${Yg}`}),p=async()=>{c(!0),h(null);try{h(await et("/api/v1/harness/try","POST",{id:e.id}))}catch(x){r(x instanceof Error?x.message:String(x),"err")}c(!1)};return t.jsxs("article",{id:`add:${e.id}`,className:`hn-row hn-add ${e.state==="off"?"off":""}`,children:[t.jsxs("div",{className:"hn-addtop",children:[t.jsxs("div",{children:[t.jsx("h3",{dir:"auto",children:e.name}),t.jsx("small",{children:iW(e)})]}),t.jsx("div",{className:"hn-seg2",role:"group","aria-label":`${e.name}: on or off`,children:(e.kind==="rule"?["on","off"]:["try","on","off"]).map(x=>t.jsx("button",{className:x===e.state?`s-${x}`:"","aria-pressed":x===e.state,disabled:s.isPending,onClick:()=>x!==e.state&&m(x),children:Pk[x]},x))})]}),e.text&&t.jsx("p",{dir:"auto",className:"hn-said",children:e.text}),e.questions&&t.jsx("ol",{dir:"auto",className:"hn-qs",children:e.questions.map(x=>t.jsx("li",{children:x},x))}),e.command&&t.jsx("code",{className:"term hn-cmd",dir:"ltr",children:e.command}),e.note&&t.jsx("p",{className:"if",children:e.note}),e.kind==="gate"&&!l&&!u&&e.tried&&t.jsx("p",{className:"if",children:e.tried.result==="passed"?`Passed in ${e.tried.seconds} seconds when tried, ${st(e.tried.at)}.`:`It fails on today's code, so it can't must-pass yet. Tried ${st(e.tried.at)}.`}),l&&t.jsx($a,{running:!0}),u&&t.jsx($a,{answer:u}),e.partGone&&t.jsx("p",{className:"if hn-warn",children:"The part it runs in is no longer in the project, so it can't run."}),e.kind==="gate"&&!n.additions.guarded&&t.jsx("p",{className:"if hn-warn",children:U5}),e.seen&&t.jsx(G5,{s:e.seen}),t.jsxs("p",{className:"hn-from",children:[e.from==="typed"?"Typed here":`From the folder ${es(e.from)}`,". Added by ",es(e.added_by),", ",st(e.added_at),"."]}),t.jsxs("div",{className:"hn-acts",children:[e.kind==="gate"&&!n.additions.demo&&t.jsxs("button",{className:"btn sm",disabled:l,onClick:()=>void p(),children:[t.jsx(kn,{size:13})," Try it now"]}),i?t.jsxs("span",{className:"hn-ask",children:["Remove it? It stays on the record.",t.jsx("button",{className:"btn sm",disabled:s.isPending,onClick:()=>s.mutate({path:`/api/v1/harness/additions/${e.id}/remove`,done:`${e.name} is removed.`}),children:"Yes, remove"}),t.jsx("button",{className:"btn sm",onClick:()=>a(!1),children:"Keep it"})]}):t.jsx("button",{className:"btn sm",onClick:()=>a(!0),children:"Remove"})]})]})}function $a({running:e,answer:n}){if(e)return t.jsxs("p",{className:"hn-try","aria-live":"polite",children:[t.jsx(xs,{size:15,className:"spin"})," Running inside the guard, on a clean copy of your code"]});if(!n)return null;const{result:s,seconds:r,why:i,output:a}=n;return t.jsxs("div",{"aria-live":"polite",children:[s==="passed"&&t.jsxs("p",{className:"hn-try ok",children:[t.jsx(ce,{size:15})," Passed in ",r," seconds"]}),s==="failed"&&t.jsx("p",{className:"hn-try you",children:"It runs, but it fails on today's code. It can stay on Try first, or be warn only."}),s==="cant-run"&&t.jsxs("p",{className:"hn-try bad",children:[t.jsx(Ue,{size:15})," It can't run, so it can't be saved. ",i]}),s!=="passed"&&a&&t.jsxs("details",{className:"hn-out",children:[t.jsx("summary",{children:"What it printed"}),t.jsx("pre",{dir:"ltr",children:a})]})]})}function Ta({title:e,back:n,close:s,children:r,footer:i}){return N.useEffect(()=>{const a=l=>l.key==="Escape"&&s();return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[s]),t.jsx("div",{className:"hn-veil",onMouseDown:a=>a.target===a.currentTarget&&s(),children:t.jsxs("aside",{className:"hn-sheet",role:"dialog","aria-modal":"true","aria-label":e,children:[t.jsxs("header",{children:[t.jsxs("div",{children:[n&&t.jsxs("button",{className:"hn-back",onClick:n,children:[t.jsx(Uv,{size:15})," Back"]}),t.jsx("h2",{children:e})]}),t.jsx("button",{className:"iconbtn","aria-label":"Close",onClick:s,children:t.jsx(Ue,{size:18})})]}),t.jsx("div",{className:"hn-sheetbody",children:r}),i&&t.jsx("footer",{children:i})]})})}function fl({label:e,value:n,options:s,set:r}){return t.jsxs("div",{className:"field",children:[t.jsx("label",{children:e}),t.jsx("div",{className:"hn-pick",role:"group","aria-label":e,children:s.map(([i,a])=>t.jsx("button",{type:"button",className:i===n?"on":"","aria-pressed":i===n,onClick:()=>r(i),children:a},i))})]})}const qk={pick:"Add to your harness",rule:"Add a rule",checklist:"Add a checklist",gate:"Add a gate",folder:"Bring in from a folder"};function cW({view:e,close:n}){const[s,r]=N.useState("pick"),i={view:e,close:n,title:qk[s],back:()=>r("pick")};if(s==="rule")return t.jsx(dW,{...i});if(s==="checklist")return t.jsx(uW,{...i});if(s==="gate")return t.jsx(pW,{...i});if(s==="folder")return t.jsx(mW,{...i});const a=[["rule",t.jsx(Dr,{size:20},"r"),"A rule","Words one agent or all agents follow."],["checklist",t.jsx(tb,{size:20},"c"),"A checklist","Questions the Reviewer or the Tester answers, one by one."],["gate",t.jsx(nl,{size:20},"g"),"A gate","A command squad-kit runs itself. Must pass, or warn only."],["folder",t.jsx(o1,{size:20},"f"),"From a folder","Your team's standard. You see what it holds, and tick what comes in."]];return t.jsxs(Ta,{title:qk.pick,close:n,children:[t.jsx("p",{className:"note",children:"Anything you add makes your squad stricter. It can't turn off a locked gate."}),t.jsx("div",{className:"hn-kinds",children:a.map(([l,c,u,h])=>t.jsxs("button",{onClick:()=>r(l),children:[t.jsx("span",{children:c}),t.jsx("b",{children:u}),t.jsx("small",{children:h})]},l))})]})}function Gg(e){const{toast:n}=Le(),s=re();return{busy:s.isPending,save:r=>s.mutate({path:"/api/v1/harness/additions",body:r},{onSuccess:i=>{n(`${i.added.name} added. ${i.note??Yg}`),e()}})}}function dW({view:e,close:n,back:s,title:r}){const[i,a]=N.useState(""),[l,c]=N.useState("all"),[u,h]=N.useState(""),{busy:m,save:p}=Gg(n),x=e.additions.limits.ruleChars;return t.jsxs(Ta,{title:r,back:s,close:n,footer:t.jsx("button",{className:"btn pri",disabled:m||!i.trim()||!u.trim()||u.length>x,onClick:()=>p({kind:"rule",name:i,agents:[l],text:u}),children:"Add the rule"}),children:[t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"hn-n",children:"Name"}),t.jsx("input",{id:"hn-n",className:"input",dir:je(i),value:i,onChange:g=>a(g.target.value)})]}),t.jsx(fl,{label:"Who follows it",value:l,set:c,options:Object.entries(iu)}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"hn-t",children:"The rule"}),t.jsx("textarea",{id:"hn-t",className:"textarea",dir:je(u),value:u,onChange:g=>h(g.target.value)}),t.jsxs("small",{className:`hn-n ${u.length>x?"over":""}`,children:[u.length," of ",x," characters"]})]}),rW.test(u)&&t.jsx("p",{className:"hn-box you",children:"This rule mentions a commit, a push or a pull request. squad-kit does those itself, so agents are told to leave that part out."}),t.jsx("p",{className:"note",children:"Rules are sent after squad-kit's own words, and can only add care. squad-kit's process comes first."})]})}function uW({view:e,close:n,back:s,title:r}){const[i,a]=N.useState(""),[l,c]=N.useState("reviewer"),[u,h]=N.useState(""),{busy:m,save:p}=Gg(n),x=u.split(`
739
+ `).map(j=>j.trim()).filter(Boolean),g=e.additions.limits.questions;return t.jsxs(Ta,{title:r,back:s,close:n,footer:t.jsx("button",{className:"btn pri",disabled:m||!i.trim()||!x.length||x.length>g,onClick:()=>p({kind:"checklist",name:i,agent:l,questions:x}),children:"Add the checklist"}),children:[t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"hn-n",children:"Name"}),t.jsx("input",{id:"hn-n",className:"input",dir:je(i),value:i,onChange:j=>a(j.target.value)})]}),t.jsx(fl,{label:"Who answers",value:l,set:c,options:[["reviewer","Reviewer"],["tester","Tester"]]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"hn-q",children:"Questions, one on each line"}),t.jsx("textarea",{id:"hn-q",className:"textarea",dir:je(u),value:u,onChange:j=>h(j.target.value)}),t.jsxs("small",{className:`hn-n ${x.length>g?"over":""}`,children:[x.length," of ",g," questions"]})]}),t.jsxs("div",{className:"hn-box",children:[t.jsx("b",{children:"If an answer is no."})," It starts on Try first: the answers show on the story and a no stops nothing. On: ",l==="reviewer"?"a no counts as a review finding, and the Builder fixes it.":'a no goes the same way as a "done when" not shown.']})]})}function hW({view:e,part:n,set:s}){return e.additions.parts.length?t.jsx(fl,{label:"Which part it runs in",value:n,set:s,options:e.additions.parts.map(r=>[r.id,r.name])}):null}function pW({view:e,close:n,back:s,title:r}){const[i,a]=N.useState(""),[l,c]=N.useState(""),[u,h]=N.useState("checks"),[m,p]=N.useState("stop"),[x,g]=N.useState(""),[j,k]=N.useState(!1),[b,w]=N.useState(null),[S,T]=N.useState(""),{busy:E,save:z}=Gg(n),$=e.additions.parts.length>0,P=async()=>{k(!0),w(null),T("");try{w(await et("/api/v1/harness/try","POST",{command:l,...x?{part:x}:{}}))}catch(W){T(W instanceof Error?W.message:String(W))}k(!1)},L=i.trim()&&b&&b.result!=="cant-run";return t.jsxs(Ta,{title:r,back:s,close:n,footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:E||!L,onClick:()=>z({kind:"gate",name:i,command:l,when:u,on_fail:m,...x?{part:x}:{}}),children:"Add the gate"}),t.jsx("span",{className:"note",children:"It starts on Try first."})]}),children:[t.jsx("p",{className:"note",children:"A command squad-kit runs itself, inside the guard. No agent can change it or talk its way past it."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"hn-n",children:"Name"}),t.jsx("input",{id:"hn-n",className:"input",dir:je(i),value:i,onChange:W=>a(W.target.value)})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"hn-c",children:"Command"}),t.jsx("input",{id:"hn-c",className:"input mono",dir:"ltr",value:l,onChange:W=>{c(W.target.value),w(null)}}),t.jsx("small",{className:"hn-n",children:"No passwords in the command: this file is shared with your team."})]}),t.jsx(fl,{label:"When it runs",value:u,set:h,options:Object.entries(W5)}),t.jsx(fl,{label:"If it fails",value:m,set:p,options:[["stop","Must pass"],["warn","Warn only"]]}),t.jsx(hW,{view:e,part:x,set:W=>{g(W),w(null)}}),t.jsxs("div",{className:"hn-box",children:[t.jsxs("div",{className:"hn-tryrow",children:[t.jsx("span",{children:"Try it once first, on your latest code, so a broken gate can't stop every story."}),t.jsxs("button",{className:"btn sm",disabled:j||!l.trim()||$&&!x,onClick:()=>void P(),children:[t.jsx(kn,{size:13})," Try it now"]})]}),j&&t.jsx($a,{running:!0}),b&&t.jsx($a,{answer:b}),S&&t.jsx("p",{className:"hn-try bad",role:"alert",children:S})]}),!e.additions.guarded&&t.jsx("p",{className:"note hn-warn",children:U5})]})}function mW({view:e,close:n,back:s,title:r}){const{at:i,setAt:a,listing:l}=Kg(),{toast:c}=Le(),[u,h]=N.useState(null),[m,p]=N.useState(""),[x,g]=N.useState(!1),[j,k]=N.useState({}),b=re(),w=(D,M)=>D??{on:!1,agent:M==="checklist"?"reviewer":"all",when:"checks",part:""},S=(D,M,Y)=>k(ae=>({...ae,[D]:{...w(ae[D],M),...Y}})),T=async()=>{g(!0),p("");try{h(await et("/api/v1/harness/folder","POST",{path:l.data?.path??i})),k({})}catch(D){p(D instanceof Error?D.message:String(D))}g(!1)},E=async D=>{const M=w(j[D.key],D.kind);S(D.key,D.kind,{running:!0,answer:void 0,problem:""});try{const Y=await et("/api/v1/harness/try","POST",{command:D.command,...M.part?{part:M.part}:{}});S(D.key,D.kind,{running:!1,answer:Y,on:Y.result!=="cant-run"})}catch(Y){S(D.key,D.kind,{running:!1,problem:Y instanceof Error?Y.message:String(Y)})}};if(!u)return t.jsxs(Ta,{title:r,back:s,close:n,footer:t.jsxs("button",{className:"btn pri",disabled:x||!l.data,onClick:()=>void T(),children:[t.jsx(o1,{size:15})," Look in this folder"]}),children:[t.jsx("p",{className:"note",children:"Bring in your team's standard. squad-kit shows what it finds, and nothing changes until you add it. Nothing in the folder runs while it looks."}),t.jsx(Vg,{at:i,go:a,listing:l,onError:p}),m&&t.jsx("p",{className:"hn-try bad",role:"alert",children:m})]});const z=u.finds.filter(D=>!D.out&&!D.already),$=z.filter(D=>D.kind!=="gate"),P=z.filter(D=>D.kind==="gate"),L=u.finds.filter(D=>D.already&&!D.out),W=u.finds.filter(D=>D.out),F=z.filter(D=>j[D.key]?.on),U=()=>b.mutate({path:"/api/v1/harness/folder/add",body:{path:u.path,picks:F.map(D=>{const M=j[D.key];return{key:D.key,agent:M.agent,when:M.when,...M.part?{part:M.part}:{}}})}},{onSuccess:D=>{c(`${D.added.length} added from ${u.name}. ${Yg}${D.left.length?` Not added: ${D.left.map(M=>`${M.name} (${M.why})`).join(", ")}`:""}`,D.left.length?"err":void 0),n()}}),I=D=>{const M=w(j[D.key],D.kind),Y=D.kind==="gate",ae=!Y||M.answer&&M.answer.result!=="cant-run";return t.jsxs("div",{className:"hn-find",children:[t.jsxs("label",{children:[t.jsx("input",{type:"checkbox",checked:M.on,disabled:!ae,onChange:H=>S(D.key,D.kind,{on:H.target.checked})}),t.jsxs("span",{children:[t.jsx("b",{dir:"auto",children:D.name}),t.jsxs("small",{dir:"auto",children:[D.kind==="checklist"?`${D.questions?.length} questions`:D.kind==="rule"?"Rule":"Gate",", from ",D.source]})]})]}),D.text&&t.jsx("p",{dir:"auto",className:"hn-said",children:D.text}),D.questions&&t.jsx("ol",{dir:"auto",className:"hn-qs",children:D.questions.map(H=>t.jsx("li",{children:H},H))}),D.command&&t.jsx("code",{className:"term hn-cmd",dir:"ltr",children:D.command}),D.kind==="rule"&&t.jsx("select",{className:"select","aria-label":"Who follows it",value:M.agent,onChange:H=>S(D.key,D.kind,{agent:H.target.value}),children:Object.entries(iu).map(([H,Z])=>t.jsx("option",{value:H,children:Z},H))}),D.kind==="checklist"&&t.jsxs("select",{className:"select","aria-label":"Who answers",value:M.agent,onChange:H=>S(D.key,D.kind,{agent:H.target.value}),children:[t.jsx("option",{value:"reviewer",children:"Reviewer"}),t.jsx("option",{value:"tester",children:"Tester"})]}),Y&&t.jsxs(t.Fragment,{children:[t.jsx("select",{className:"select","aria-label":"When it runs",value:M.when,onChange:H=>S(D.key,D.kind,{when:H.target.value}),children:Object.entries(W5).map(([H,Z])=>t.jsx("option",{value:H,children:Z},H))}),e.additions.parts.length>0&&t.jsxs("select",{className:"select","aria-label":"Which part it runs in",value:M.part,onChange:H=>S(D.key,D.kind,{part:H.target.value,answer:void 0,on:!1}),children:[t.jsx("option",{value:"",children:"Which part?"}),e.additions.parts.map(H=>t.jsx("option",{value:H.id,children:H.name},H.id))]}),t.jsxs("div",{className:"hn-tryrow",children:[t.jsx("span",{className:"note",children:"Each command needs its own try before it can be ticked."}),t.jsxs("button",{className:"btn sm",disabled:M.running||e.additions.parts.length>0&&!M.part,onClick:()=>void E(D),children:[t.jsx(kn,{size:13})," Try it now"]})]}),M.running&&t.jsx($a,{running:!0}),M.answer&&t.jsx($a,{answer:M.answer}),M.problem&&t.jsx("p",{className:"hn-try bad",role:"alert",children:M.problem})]})]},D.key)};return t.jsxs(Ta,{title:r,back:()=>h(null),close:n,footer:t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn pri",disabled:!F.length||b.isPending,onClick:U,children:["Add ",F.length," to your harness"]}),t.jsx("span",{className:"note",children:"You can turn each one off later."})]}),children:[t.jsxs("p",{className:"note",dir:"auto",children:["What ",u.name," holds. ",u.left>0?`Left out: ${u.left} too big, not text, keys or links leading out.`:""," ",u.more?"It holds more files than squad-kit looks at.":""]}),!u.finds.length&&t.jsxs("div",{className:"hn-empty",children:[t.jsx("b",{children:"Nothing to bring in here."}),t.jsx("p",{className:"note",children:"squad-kit looks for rule files, checkbox lists, a scripts/check and package scripts."})]}),$.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"hn-sub",children:"Rules and checklists"}),$.map(I)]}),P.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"hn-sub",children:"Commands"}),P.map(I)]}),L.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"hn-sub",children:"Already added"}),L.map(D=>t.jsxs("div",{className:"hn-find out",children:[t.jsx("b",{dir:"auto",children:D.name}),t.jsx("small",{children:"Already added"})]},D.key))]}),W.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{className:"hn-sub",children:"squad-kit already does these"}),t.jsx("p",{className:"note",children:"Adding them would make two processes fight, so they stay out."}),W.map(D=>t.jsxs("div",{className:"hn-find out",children:[t.jsx("b",{dir:"auto",children:D.name}),t.jsx("small",{children:D.out})]},D.key))]})]})}const fW=[["line","The line"],["compare","Compare tracks"],["limits","Limits"],["safety","Safety"],["agents","Agents"],["additions","Your additions"]],gW=[["all","All"],["you","You decide"],["stopped","Stopped something"],["needs","Needs you"],["team","Added by your team"]],H5="Nothing matches that. Try another word, or clear the search.";function xW(){const e=_r({from:"/harness"}),n=_t(),s=e.tab??"line",r=De(),i=r.data?.ready?r.data.meta.quality:void 0,a=ve({queryKey:["harness",i],queryFn:()=>ye("/api/v1/harness"),refetchInterval:15e3}).data,[l,c]=N.useState("full"),[u,h]=N.useState("checks"),[m,p]=N.useState("all"),[x,g]=N.useState(""),[j,k]=N.useState(""),b=$=>void n({to:"/harness",search:$==="line"?{}:{tab:$},replace:!0}),w=$=>{p($),g("")},S=$=>{h($),w("all"),k(""),matchMedia("(max-width: 760px)").matches&&requestAnimationFrame(()=>document.querySelector(".hn-body")?.scrollIntoView())},T=a?.tiles.needs??[],E=!!a;N.useEffect(()=>{const $=()=>{const P=decodeURIComponent(location.hash.slice(1)),L=a?.stages.find(W=>W.gates.some(F=>F.id===P));!L&&!a?.alwaysOn.some(W=>W.id===P)||(L&&h(L.id),w("all"),k(P),s!=="line"&&b("line"),setTimeout(()=>document.getElementById(P)?.scrollIntoView({block:"center"}),60))};return $(),addEventListener("hashchange",$),()=>removeEventListener("hashchange",$)},[E]);const z=a&&t.jsxs(t.Fragment,{children:[t.jsx("b",{className:"ok",children:a.tiles.working})," gates working, ",t.jsx("b",{children:a.tiles.stopped})," stopped something this week, ",t.jsx("b",{className:"you",children:T.length})," needs you"]});return t.jsxs("div",{className:"scroll",children:[s==="line"?t.jsxs("header",{className:"hn-hero",children:[t.jsxs("div",{className:"hn-head",children:[t.jsxs("div",{children:[t.jsx("h1",{children:"Your harness"}),t.jsx("p",{children:"Every gate, rule and limit, exactly as the engine runs them. They are locked, so nothing can weaken them."})]}),t.jsx("div",{className:"hn-seg",role:"group","aria-label":"Track",children:a?.tracks.map($=>t.jsx("button",{className:$.id===l?"on":"","aria-pressed":$.id===l,onClick:()=>c($.id),children:$.name},$.id))})]}),a&&t.jsxs("div",{className:"hn-count",children:[t.jsxs("button",{onClick:()=>w("all"),children:[t.jsx("b",{className:"ok",children:a.tiles.working}),"gates working"]}),t.jsxs("button",{onClick:()=>w("stopped"),children:[t.jsx("b",{children:a.tiles.stopped}),"stopped something this week"]}),t.jsxs("button",{className:"you",onClick:()=>{const $=T.length===1?T[0]:null;$?$.proof?n({to:"/tickets/$id/proof",params:{id:$.id}}):n({to:"/board",search:{ticket:$.id}}):w("needs")},children:[t.jsx("b",{children:T.length}),"needs you now"]})]}),a&&t.jsx(yW,{stages:a.stages,track:l,on:m==="all"&&!x.trim()?u:"",pick:S})]}):t.jsxs("header",{className:"hn-hero slim",children:[t.jsx("h1",{children:"Your harness"}),t.jsx("p",{children:z})]}),t.jsx("nav",{className:"hn-tabs","aria-label":"Harness",children:fW.map(([$,P])=>t.jsx("button",{className:$===s?"on":"","aria-current":$===s?"page":void 0,onClick:()=>b($),children:P},$))}),t.jsxs("div",{className:"hn-body",children:[a&&s==="line"&&t.jsx(jW,{view:a,stageId:u,track:l,chip:m,setChip:p,q:x,setQ:g,spot:j}),a&&s==="compare"&&t.jsx(vW,{view:a}),a&&s==="limits"&&t.jsx(wW,{view:a}),a&&s==="safety"&&t.jsx(NW,{view:a}),a&&s==="agents"&&t.jsx(CW,{view:a}),a&&s==="additions"&&t.jsx(oW,{view:a})]})]})}function yW({stages:e,track:n,on:s,pick:r}){const i=N.useRef(null);return N.useEffect(()=>{const a=i.current?.querySelector(".on");a&&(i.current.scrollLeft=a.offsetLeft-i.current.clientWidth/2)},[s]),t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"hn-wrap",ref:i,children:t.jsx("div",{className:"hn-line",children:e.map((a,l)=>t.jsxs("button",{className:`hn-stop ${a.on[n].kind} ${a.id===s?"on":""}`,"aria-pressed":a.id===s,onClick:()=>r(a.id),children:[t.jsxs("i",{children:[l+1,!!a.stopped&&t.jsx("u",{"aria-label":`Stopped ${a.stopped} this week`,children:a.stopped})]}),t.jsx("b",{children:a.name}),t.jsx("small",{children:a.on[n].sub})]},a.id))})}),t.jsxs("div",{className:"hn-legend",children:[t.jsx("span",{children:"Green: squad-kit runs it, locked"}),t.jsx("span",{children:"Amber: you decide"}),t.jsx("span",{children:"Dashed: happens on its own on this track"}),t.jsx("span",{children:"Red number: stopped something this week"})]})]})}function K5(){const{engineers:e,toggleEngineers:n}=Le();return t.jsx(V5,{on:e,flip:n,name:"For engineers"})}function V5({on:e,flip:n,name:s}){return t.jsxs("button",{className:"hn-sw","aria-pressed":e,onClick:n,children:[t.jsx("span",{className:`tog ${e?"on":""}`}),s]})}function Y5({s:e}){return t.jsx(ge,{to:"/board",search:{ticket:e.id},title:e.title,children:e.id})}function G5({s:e}){const n=e.passed!==void 0,s=(e.passed??0)+(e.stopped??0);return t.jsxs("div",{className:"hn-res",children:[n&&s>0&&t.jsx("div",{className:"bar",children:t.jsx("i",{style:{width:`${(e.passed??0)/s*100}%`}})}),n&&s>0&&t.jsxs("div",{children:[t.jsx("b",{children:e.passed})," passed, ",t.jsx("b",{children:e.stopped})," stopped",e.week?`, ${e.week} this week`:""]}),!n&&!!e.stopped&&t.jsxs("div",{children:["Stopped ",t.jsx("b",{children:e.stopped}),e.stopped===1?" story":" stories",e.week?`, ${e.week} this week`:""]}),e.last&&t.jsxs("div",{children:["Last stopped ",t.jsx(Y5,{s:e.last}),", ",st(e.last.at)]}),e.did&&t.jsx("div",{children:e.did})]})}function Ik({r:e,track:n,view:s,tag:r,spot:i}){const{engineers:a}=Le(),[l,c]=N.useState(!1),u=a||l,h=e.skip?.includes(n),m=e.skip?.map(p=>s.tracks.find(x=>x.id===p)?.name).join(" and ");return t.jsxs("article",{id:e.id,className:`hn-row ${h?"off":""} ${i?"spot":""}`,children:[t.jsxs("div",{className:"hn-top",children:[t.jsxs("div",{children:[t.jsxs("h3",{dir:e.team?"auto":void 0,children:[e.name,e.you&&t.jsx("em",{children:"You decide"}),e.team&&t.jsxs("small",{className:"hn-team",children:["Added by your team",e.team.state==="try"?", on Try first":""]}),r&&t.jsx("small",{children:r}),t.jsx("a",{href:`#${e.id}`,"aria-label":`A link to ${e.name}`,children:"#"})]}),t.jsxs("p",{dir:e.team?"auto":void 0,children:[e.note?.[n]?`${e.note[n]} `:"",e.what]}),e.fail&&t.jsxs("p",{className:"if",children:[t.jsx("b",{children:"If it fails:"})," ",e.fail]}),e.then&&t.jsx("p",{className:"if",children:e.then}),m&&t.jsxs("p",{className:"if",children:["Skipped on ",m,"."]})]}),e.seen&&t.jsx(G5,{s:e.seen})]}),e.needs?.map(p=>t.jsxs("div",{className:"hn-need",children:[t.jsxs("span",{children:[t.jsx("b",{children:p.id})," ",p.summary]}),p.proof?t.jsx(ge,{className:"btn pri sm",to:"/tickets/$id/proof",params:{id:p.id},children:"Open the story"}):t.jsx(ge,{className:"btn pri sm",to:"/board",search:{ticket:p.id},children:"Open the story"})]},p.id)),t.jsx("button",{className:"hn-more","aria-expanded":u,onClick:()=>c(!l),children:u?"Hide the details":"Details"}),u&&t.jsx("dl",{children:e.d?.map(([p,x])=>t.jsxs(N.Fragment,{children:[t.jsx("dt",{children:p}),t.jsx("dd",{className:"mono",children:x})]},p))})]})}function jW({view:e,stageId:n,track:s,chip:r,setChip:i,q:a,setQ:l,spot:c}){const u=a.trim().toLowerCase(),h=!!u||r!=="all",m=(S,T="")=>u&&!`${S.name} ${S.what} ${S.fail??""} ${S.then??""} ${T} ${S.d?.flat().join(" ")}`.toLowerCase().includes(u)?!1:r==="you"?!!S.you:r==="team"?!!S.team:r==="stopped"?!!S.seen?.week:r!=="needs"||!!S.needs?.length,p=e.stages.find(S=>S.id===n),x=e.stages.filter(S=>h||S===p).flatMap(S=>S.gates.filter(T=>m(T,S.name)).map(T=>({g:T,s:S}))),g=e.alwaysOn.filter(S=>m(S)),{days:j,weekDays:k,stories:b}=e.range,w=u?`${x.length+g.length} found`:r==="all"?p.name:{you:"You decide",stopped:"Stopped something this week",needs:"Needs you now",team:"Added by your team"}[r];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"hn-tools",children:[t.jsxs("label",{children:["Search every gate and rule",t.jsx("input",{className:"input",dir:je(a),value:a,placeholder:"Try tests, Docker, picture, refused",onChange:S=>l(S.target.value)})]}),t.jsx("div",{className:"hn-chips",role:"group","aria-label":"Show",children:gW.map(([S,T])=>t.jsx("button",{className:S===r?"on":"","aria-pressed":S===r,onClick:()=>i(S),children:T},S))}),t.jsx(K5,{})]}),t.jsx("p",{className:"note hn-range",children:b?`Counted from this project's ${b} ${b===1?"story":"stories"} on this computer, last ${j} days. This week: the last ${k} days. No record, no number.`:`No stories on this computer in the last ${j} days, so no numbers yet.`}),t.jsx("h2",{className:"hn-title hn-gap",children:w}),t.jsx("p",{className:"note hn-lead",children:h?"From every stage of the line.":p.about}),!x.length&&!g.length&&t.jsx("div",{className:"hn-none",children:H5}),x.length>0&&t.jsx("div",{className:"hn-card",children:x.map(({g:S,s:T})=>t.jsx(Ik,{r:S,track:s,view:e,tag:h?T.name:void 0,spot:c===S.id},S.id))}),g.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h2",{className:"hn-title hn-gap",children:"Working in every step"}),t.jsx("p",{className:"note hn-lead",children:"These belong to no stage. They watch the whole line, on every track."}),t.jsx("div",{className:"hn-card",children:g.map(S=>t.jsx(Ik,{r:S,track:s,view:e,spot:c===S.id},S.id))})]})]})}const kW={You:"you",Runs:"runs","By itself":"self","Not used":"none"};function vW({view:e}){const[n,s]=N.useState(!1),r=i=>new Set(e.tracks.map(a=>JSON.stringify(i.cells?.[a.id]))).size>1;return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"hn-tools",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"hn-title",children:"What each track does for you"}),t.jsx("p",{className:"note",children:"The quality gates run on every track. The tracks differ only in how much you are asked."})]}),t.jsx(V5,{on:n,flip:()=>s(!n),name:"Only what differs"})]}),t.jsxs("p",{className:"note hn-lead",children:[t.jsx("b",{children:"Runs"}),": squad-kit does it, locked. ",t.jsx("b",{children:"You"}),": it waits for you. ",t.jsx("b",{children:"By itself"}),": decided for you, and logged. ",t.jsx("b",{children:"Not used"}),": not part of this track."]}),t.jsxs("div",{className:"hn-card hn-cmp",role:"table","aria-label":"Gates on each track",children:[t.jsxs("div",{className:"hn-cr head",role:"row",children:[t.jsx("span",{role:"columnheader",children:"Gate"}),e.tracks.map(i=>t.jsx("span",{role:"columnheader",children:i.name},i.id))]}),e.stages.map(i=>{const a=i.gates.filter(l=>!n||r(l));return a.length?t.jsxs(N.Fragment,{children:[t.jsx("div",{className:"hn-cs",children:i.name}),a.map(l=>t.jsxs("div",{className:"hn-cr",role:"row",children:[t.jsxs("span",{role:"rowheader",dir:l.team?"auto":void 0,children:[l.name,l.team&&t.jsx("small",{className:"hn-team",children:"Added by your team"})]}),e.tracks.map(c=>t.jsxs("span",{role:"cell",className:kW[l.cells?.[c.id].word??""],"data-t":c.name,children:[l.cells?.[c.id].word,l.cells?.[c.id].note&&t.jsx("small",{children:l.cells[c.id].note})]},c.id))]},l.id))]},i.id):null})]})]})}const bW=[["tries","Tries and rounds"],["pictures","Pictures and proof"],["asks","Asks and refusals"],["time","Time limits"],["sizes","Sizes and places"]];function wW({view:e}){const{engineers:n}=Le(),[s,r]=N.useState(""),[i,a]=N.useState(!1),l=s.trim().toLowerCase(),c=e.limits.filter(u=>(!l||`${u.n} ${u.name} ${u.what} ${u.id}`.toLowerCase().includes(l))&&(!i||u.hit));return t.jsxs(t.Fragment,{children:[t.jsx("h2",{className:"hn-title",children:"Your squad can't go round in circles"}),t.jsx("p",{className:"note hn-lead",children:"Every loop has an end. When one is reached, the work is kept and you decide what happens next."}),t.jsxs("div",{className:"hn-tools",children:[t.jsxs("label",{children:["Search the limits",t.jsx("input",{className:"input",dir:je(s),value:s,placeholder:"Try picture, Docker, rounds",onChange:u=>r(u.target.value)})]}),t.jsx("div",{className:"hn-chips",children:t.jsxs("button",{className:i?"on":"","aria-pressed":i,onClick:()=>a(!i),children:["Reached in ",e.range.days," days"]})}),t.jsx(K5,{})]}),!c.length&&t.jsx("div",{className:"hn-none hn-gap",children:H5}),bW.map(([u,h])=>{const m=c.filter(p=>p.group===u);return m.length>0&&t.jsxs("section",{children:[t.jsx("h3",{className:"hn-sub",children:h}),t.jsx("div",{className:"hn-ledger",children:m.map(p=>t.jsxs("div",{className:"hn-lim",children:[t.jsx("b",{children:p.n}),t.jsxs("span",{children:[t.jsx("strong",{children:p.name}),p.what,p.hit&&t.jsxs("em",{children:["Reached on ",t.jsx(Y5,{s:p.hit}),", ",st(p.hit.at)]}),n&&t.jsx("code",{className:"mono",children:p.id})]})]},p.id))})]},u)}),!l&&!i&&t.jsxs(t.Fragment,{children:[t.jsxs("h3",{className:"hn-sub",children:["The most one run can use, on ",Wf.find(u=>u.id===e.quality)?.name]}),t.jsx("p",{className:"note hn-lead",children:"Reaching one pauses the step with its work kept. Give it more doubles it."}),t.jsxs("table",{className:"table",children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:"Step"}),t.jsx("th",{children:"Agent turns"}),t.jsx("th",{children:"Spend at API prices"})]})}),t.jsx("tbody",{children:e.caps.map(u=>t.jsxs("tr",{children:[t.jsx("td",{children:u.name}),t.jsx("td",{children:u.turns}),t.jsxs("td",{children:["$",u.spendUsd]})]},u.key))})]})]})]})}function ai({title:e,what:n,items:s,mine:r=[],children:i}){return t.jsxs("div",{className:"hn-block",children:[t.jsxs("div",{children:[t.jsx("h3",{children:e}),t.jsx("p",{className:"note",children:n})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"pills",children:[s.map(a=>t.jsxs("span",{className:"pill wait",children:[t.jsx(fu,{size:13,"aria-label":"Locked"}),a]},a)),r.map(a=>t.jsx("span",{className:"pill you mono",children:a},a))]}),i]})]})}function NW({view:e}){const n=De(),s=n.data?.ready?n.data.meta:void 0,r=Ml().data,i=e.safety,a=!!(r&&r.tools.some(c=>c.available)&&r.guard?.on),l=[...r?.guard?.allowRead??[],...r?.guard?.allowWrite??[]];return t.jsxs(t.Fragment,{children:[t.jsx("h2",{className:"hn-title",children:"What your squad can never touch."}),r&&t.jsxs("div",{className:"hn-lead",children:[t.jsxs("span",{className:`pill ${a?"ok":"you"}`,children:[a?t.jsx(ja,{size:15}):t.jsx(c1,{size:15}),a?"Guard on, on this computer":"Less protected on this computer"]}),!a&&t.jsx(z5,{})]}),t.jsx(ai,{title:"Hidden from the squad",what:"The Builder, the Tester and your project's own commands can't read these. No agent can read squad-kit's keys or a local file.",items:i.hidden,mine:i.local,children:l.length>0&&t.jsxs("p",{className:"note hn-lead",children:["An engineer let your project's own commands use ",t.jsx("span",{className:"mono",children:l.join(", ")}),". See Settings."]})}),t.jsx(ai,{title:"No agent can change",what:"A change goes back by itself, with a line saying so.",items:i.locked,mine:i.lockedByYou}),s?.engine==="live"&&t.jsx(ai,{title:"Your own database",what:"A story never works on it. squad-kit only reads it, to make the copy stories start from.",items:[],children:t.jsx(RB,{})}),t.jsxs(ai,{title:"Where agents can go",what:"The Builder only. The others have no internet, and the Tester's pictures stay on this story's app.",items:i.sites,mine:s?.engine==="live"?[]:s?.allowedHosts??[],children:[t.jsx(xB,{net:i.network,live:s?.engine==="live"}),s?.engine==="live"&&t.jsx(jB,{hosts:s.allowedHosts??[]})]}),t.jsx(ai,{title:"Closed on every level",what:"Sites with no use in building software, but common for taking data out. A site refused stops nothing: the work goes on without it.",items:i.network.closed}),t.jsx(ai,{title:"Questions that never reach you",what:"They are refused and logged, and the agent gets on with it.",items:i.refused}),t.jsx(ai,{title:"What agents can ask squad-kit to do",what:"There is no free command. squad-kit checks every field and does the job itself.",items:i.tools})]})}const SW={claude:"Claude Code",codex:"Codex"};function CW({view:e}){const n=De(),s=jb(),r=n.data?.ready?n.data.meta:void 0,i=ve({queryKey:["agents"],queryFn:()=>ye("/api/v1/agents"),refetchInterval:2e3}).data??[],[a,l]=N.useState("builder"),[c,u]=N.useState(null),h=i.find(m=>m.role===a);return t.jsxs(t.Fragment,{children:[t.jsx(EW,{notes:e.qualityNote}),t.jsx(uO,{}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Stories at once"}),t.jsxs("span",{className:"note",children:["Up to ",s.data?.parallel??r?.parallel??2,", shared by all your projects. Change it in Settings."]})]}),t.jsx("div",{className:"hn-tiles",children:i.map(m=>t.jsxs("button",{className:`hn-tile ${m.role===a?"on":""}`,"aria-pressed":m.role===a,onClick:()=>l(m.role),children:[t.jsx(Ni,{role:m.role}),t.jsx("b",{children:m.name}),t.jsx("small",{children:m.working.length?`Working on ${m.working.map(p=>p.id).join(", ")}`:Qg(m.levels.find(p=>p.step==="design")?.now??m.levels[0].now)})]},m.role))}),h&&t.jsx($W,{a:h,view:e,edit:()=>u(h)}),t.jsx(TW,{lead:e.lead}),t.jsx(iO,{}),t.jsx("h2",{className:"hn-gap",children:"Your AI tools"}),t.jsx("p",{className:"note",style:{marginTop:2},children:"squad-kit uses the logins you already have. Nothing new to buy."}),(r?.tools??[]).map(m=>t.jsxs("div",{className:"toolrow",children:[t.jsx("span",{className:"logo",children:t.jsx(nl,{size:18})}),t.jsxs("span",{children:[t.jsx("b",{children:m.name}),t.jsx("br",{}),t.jsx("span",{className:"note",children:m.name==="Codex"?"Your ChatGPT subscription":"Your Claude subscription"})]}),t.jsx("span",{className:`pill ${m.ready?"ok":"wait"}`,children:m.ready?"Ready":"Not found"})]},m.name)),t.jsx(z5,{}),t.jsxs("div",{className:"toolrow off",children:[t.jsx("span",{className:"logo",children:t.jsx(nl,{size:18})}),t.jsxs("span",{children:[t.jsx("b",{children:"Gemini CLI, Copilot CLI, Cursor"}),t.jsx("br",{}),t.jsx("span",{className:"note",children:"Coming next"})]}),t.jsx("span",{})]}),c&&t.jsx(AW,{agent:c,onClose:()=>u(null)})]})}function $W({a:e,view:n,edit:s}){const r=ve({queryKey:["core-prompts",e.role],queryFn:()=>ye(`/api/v1/agents/${e.role}/prompts`)}),i=u=>zb(u??"").trim(),a=[{id:"all",name:"Every step",text:i(e.instructions)},...e.stepList.map(u=>({id:u.id,name:u.name,text:i(e.steps?.[u.id])}))].filter(u=>u.text),l=n.caps.filter(u=>u.key.split(".")[0]===e.role),c=n.additions.items.filter(u=>u.kind==="rule"&&u.state==="on"&&(u.agents?.includes("all")||u.agents?.includes(e.role)));return t.jsxs("div",{className:"hn-two even",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"hn-title",children:e.name}),t.jsxs("p",{className:"note",children:[e.job,"."]}),e.working.map(u=>t.jsxs(ge,{className:"hn-now",to:"/board",search:{ticket:u.id},children:[t.jsx("b",{className:"mono",children:u.id})," ",u.status]},u.id)),t.jsx("h3",{className:"hn-sub",children:"What it can do"}),t.jsx("ul",{className:"hn-can",children:n.agents[e.role]?.can.map(([u,h])=>t.jsxs("li",{className:h?"":"no",children:[h?t.jsx(ce,{size:16,"aria-label":"Yes"}):t.jsx(Ue,{size:16,"aria-label":"No"}),u]},u))}),t.jsxs("h3",{className:"hn-sub",children:["Your rules for the ",e.name]}),a.map(u=>t.jsxs("p",{className:"hn-rule",children:[t.jsxs("b",{children:[u.name,"."]})," ",u.text]},u.id)),c.map(u=>t.jsxs("p",{className:"hn-rule",dir:"auto",children:[t.jsxs("b",{children:[u.name,"."]})," ",u.text," ",t.jsx("small",{className:"hn-team",children:"Added by your team"})]},u.id)),!a.length&&!c.length&&t.jsx("p",{className:"note",children:"Nothing added yet."}),t.jsxs("button",{className:"btn sm hn-edit",onClick:s,children:["Edit the ",e.name]})]}),t.jsxs("div",{children:[t.jsx("h3",{className:"hn-sub",children:"How it runs"}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"AI tool"}),t.jsx("span",{className:"note",children:SW[e.tool]})]}),e.levels.map(u=>t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:u.name}),t.jsx("span",{className:"note",children:Qg(u.now)})]},u.step)),l.map(u=>t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:u.name}),t.jsxs("span",{className:"note",children:["Up to ",u.turns," turns and $",u.spendUsd," for one run."]})]},u.key)),t.jsx("h3",{className:"hn-sub",children:"What it reads before it starts"}),t.jsxs("p",{className:"note",children:["Read only, and improved with every release. Your rules are added to these words and never replace them.",r.data&&` Filled in from ${r.data.ticket.title}.`]}),t.jsx("div",{className:"hn-card hn-reads",children:e.stepList.map(u=>t.jsxs("details",{children:[t.jsxs("summary",{children:[t.jsx(fu,{size:14,"aria-label":"Locked"}),u.name]}),t.jsx("pre",{className:"coreprompt",children:r.data?.prompts.find(h=>h.step===u.id)?.prompt??(r.isLoading?"Loading…":"Not available.")})]},u.id))})]})]})}function TW({lead:e}){const n=e.always.can.filter(s=>e.always.on.includes(s.id)).map(s=>s.name);return t.jsxs("div",{className:"hn-two even hn-gap",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"hn-title",children:"The Squad lead"}),t.jsx("p",{className:"note",children:"One contact for the whole project. It answers, drafts and passes work on; you press the button."}),e.levels.map(s=>t.jsxs(N.Fragment,{children:[t.jsx("h3",{className:"hn-sub",children:s.name}),t.jsx("p",{className:"note",children:s.words}),t.jsx("ul",{className:"hn-can",children:s.items.map(r=>t.jsxs("li",{className:s.level===3?"no":"",children:[s.level===3?t.jsx(Ue,{size:16,"aria-label":"Never"}):t.jsx(ce,{size:16,"aria-label":"Yes"}),r]},r))})]},s.level))]}),t.jsxs("div",{children:[t.jsx("h3",{className:"hn-sub",children:"How it runs"}),t.jsx("p",{className:"note",children:e.model}),e.limits.map(s=>t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:s.name}),t.jsxs("span",{className:"note",children:[s.n,". ",s.what]})]},s.name)),t.jsx("h3",{className:"hn-sub",children:"Without asking"}),t.jsx("p",{className:"note",children:e.always.words}),t.jsxs("div",{className:"maprow",children:[t.jsx("b",{children:"Always allow"}),t.jsx("span",{className:"note",children:n.length?n.join(", "):"Nothing yet"})]}),t.jsx(ge,{className:"btn sm hn-edit",to:"/lead",children:"Change it on the Squad lead page"}),t.jsx("h3",{className:"hn-sub",children:"What it may read"}),t.jsx("ul",{className:"hn-can",children:e.reads.map(s=>t.jsxs("li",{children:[t.jsx(ce,{size:16,"aria-label":"Yes"}),s]},s))})]})]})}const Wf=[{id:"best",name:"Best"},{id:"balanced",name:"Balanced"},{id:"thrifty",name:"Thrifty"}];function EW({notes:e}){const n=De(),s=re(),r=n.data?.ready?n.data.meta:void 0;if(!r)return null;const i=r.quality??"best";return t.jsxs("div",{className:"maprow",style:{marginTop:6},children:[t.jsx("b",{style:{paddingTop:4},children:"Quality"}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:6,minWidth:0},children:[t.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center",flexWrap:"wrap"},children:[Wf.map(a=>t.jsx("button",{className:`btn sm ${a.id===i?"pri":""}`,"aria-pressed":a.id===i,onClick:()=>s.mutate({path:"/api/v1/settings",method:"PUT",body:{quality:a.id},done:`Quality is ${a.name} now. The squad uses it from its next step.`}),children:a.name},a.id)),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad config set quality ${i}`})]}),Wf.map(a=>t.jsxs("span",{className:"note",style:{fontSize:12.5,...a.id===i?{color:"var(--text)"}:{}},children:[t.jsxs("b",{children:[a.name,":"]})," ",e[a.id]]},a.id))]})]})}function AW({agent:e,onClose:n}){const s=re(),r=E=>zb(E??"").trim(),[i,a]=N.useState(e.tool),[l,c]=N.useState(e.model),[u,h]=N.useState(e.youRole?.model??""),[m,p]=N.useState(()=>Object.fromEntries(e.levels.map(E=>[E.step,E.team??{}]))),[x,g]=N.useState(()=>Object.fromEntries(e.levels.map(E=>[E.step,E.you??{}]))),[j,k,b]=$e(`agent-${e.role}`,"instructions",r(e.instructions)),[w,S]=N.useState(()=>Object.fromEntries(e.stepList.map(E=>[E.id,r(e.steps?.[E.id])]))),T=async()=>{const E=($,P)=>($?.level??"")===(P.level??"")&&($?.effort??"")===(P.effort??"");try{for(const $ of e.levels)E($.you,x[$.step])||await et("/api/v1/me/levels","PUT",{key:`${e.role}.${$.step}`,...x[$.step]});(e.youRole?.model??"")!==u.trim()&&await et("/api/v1/me/levels","PUT",{key:e.role,...e.youRole,model:u.trim()})}catch($){return s.reset(),alert($ instanceof Error?$.message:String($))}const z={};(e.teamRole?.level||e.teamRole?.effort)&&(z[e.role]={level:e.teamRole.level,effort:e.teamRole.effort});for(const[$,P]of Object.entries(m))(P.level||P.effort)&&(z[`${e.role}.${$}`]=P);s.mutate({path:`/api/v1/agents/${e.role}`,method:"PUT",body:{tool:i,model:l,instructions:j,steps:w,levels:z},done:`${e.name} saved. It uses this from its next step.`},{onSuccess:()=>{b(),n()}})};return t.jsxs(Ye,{title:`Edit the ${e.name}`,wide:!0,onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:s.isPending,onClick:T,children:"Save"}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx("span",{className:"note mono",style:{fontSize:12},children:e.file})]}),children:[t.jsxs("p",{className:"note",style:{marginTop:0},children:[e.job,"."]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"AI tool"}),t.jsxs("select",{className:"input",value:i,onChange:E=>a(E.target.value),children:[t.jsx("option",{value:"claude",children:"Claude Code"}),t.jsx("option",{value:"codex",disabled:!0,children:"Codex (coming soon)"})]})]}),t.jsx(RW,{agent:e,team:m,setTeam:p,you:x,setYou:g}),t.jsxs("details",{style:{marginTop:8},children:[t.jsx("summary",{className:"note",children:"Pin exact models (advanced)"}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"For the team"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:l,placeholder:"Empty: use the levels above",onChange:E=>c(E.target.value)})]}),t.jsxs("div",{className:"maprow",style:{alignItems:"center"},children:[t.jsx("b",{children:"Just for me"}),t.jsx("input",{className:"input mono",style:{fontSize:13},value:u,placeholder:"Empty: use the levels above",onChange:E=>h(E.target.value)})]}),t.jsx("p",{className:"note",style:{fontSize:12.5},children:"A pinned model wins over every level. Levels are better for the team: they work whatever AI tool each person uses."})]}),t.jsxs("div",{style:{marginTop:12},children:[t.jsx("b",{style:{display:"block",marginBottom:6},children:"House rules for every step"}),t.jsx("textarea",{className:"input",rows:4,style:{width:"100%",resize:"vertical"},dir:je(j),value:j,placeholder:`Extra instructions the ${e.name} reads in every step, in plain words.`,onChange:E=>k(E.target.value)})]}),e.stepList.map(E=>t.jsxs("div",{className:"agentstep",children:[t.jsx("b",{children:E.name}),t.jsx("textarea",{className:"input",rows:2,style:{width:"100%",resize:"vertical"},dir:je(w[E.id]??""),value:w[E.id]??"",placeholder:`Only for the ${E.name} step. For example: ${qW[E.id]??"keep it short"}.`,onChange:z=>S({...w,[E.id]:z.target.value})})]},E.id))]})}function Qg(e){const n=e.from==="project"?"set by the team":e.from==="you"?"set by you":"squad-kit's default";return`${e.modelName||e.level} (${e.model?"pinned":e.level}${e.effort?`, ${kd[e.effort]} effort`:""}), ${n}${e.why?`, ${e.why}`:""}`}const PW={strongest:"Strongest",balanced:"Balanced",fast:"Fast"},kd={xhigh:"extra high",high:"high",medium:"medium",low:"low"};function Fk({value:e,onChange:n,below:s,agent:r}){return t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:4,minWidth:0},children:[t.jsxs("select",{className:"input",style:{fontSize:12.5,padding:"4px 6px",width:"100%"},value:e.level??"",onChange:i=>n({...e,level:i.target.value||void 0}),"aria-label":"Level",children:[t.jsxs("option",{value:"",children:["Default",s.level?` (${s.level})`:""]}),["strongest","balanced","fast"].map(i=>t.jsxs("option",{value:i,children:[PW[i],r.modelOf[i]?` · ${r.modelOf[i]}`:""]},i))]}),r.supportsEffort&&t.jsxs("select",{className:"input",style:{fontSize:12.5,padding:"4px 6px",width:"100%"},value:e.effort??"",onChange:i=>n({...e,effort:i.target.value||void 0}),"aria-label":"Effort",children:[t.jsxs("option",{value:"",children:["Default",s.effort?` (${kd[s.effort]} effort)`:""]}),r.efforts.map(i=>t.jsxs("option",{value:i,children:[kd[i].charAt(0).toUpperCase(),kd[i].slice(1)," effort"]},i))]})]})}function RW({agent:e,team:n,setTeam:s,you:r,setYou:i}){return t.jsxs("div",{style:{marginTop:12},children:[t.jsx("b",{style:{display:"block",marginBottom:2},children:"Models"}),t.jsx("p",{className:"note",style:{marginTop:0,fontSize:12.5},children:"squad-kit picks a level for each step from the Quality setting: strongest where a mistake is expensive, cheaper where the work is clear. Change it for the whole team, or just for you. After a failed try, the Builder moves up a level on its own."}),t.jsxs("div",{className:"levels",role:"table",children:[t.jsxs("div",{className:"levrow head",role:"row",children:[t.jsx("span",{children:"Step"}),t.jsx("span",{children:"For the team"}),t.jsx("span",{children:"Just for me"}),t.jsx("span",{children:"Now"})]}),e.levels.map(a=>t.jsxs("div",{className:"levrow",role:"row",children:[t.jsx("span",{children:a.name}),t.jsx(Fk,{agent:e,value:n[a.step]??{},below:a.standard,onChange:l=>s({...n,[a.step]:l})}),t.jsx(Fk,{agent:e,value:r[a.step]??{},below:{...a.standard,...n[a.step]??{}},onChange:l=>i({...r,[a.step]:l})}),t.jsx("span",{className:"note",style:{fontSize:12.5},children:Qg(a.now)})]},a.step))]})]})}const qW={questions:"always ask who will use it",spec:'write "done when" items a clerk can check by hand',scan:"the old /legacy folder is not used",design:"prefer the existing service layer over new packages",build:"use our logger, never console.log",fix:"never turn a failing test off",review:"check every query for missing tenant filters",proof:"take screenshots in Arabic too"};function IW(e,n,s){return[...(n&&e.startsWith(n)?e.slice(n.length):e).split(/[/\\]/).filter(Boolean),s||"Your project"].join(" / ")}function Lk({onClose:e}){const[n,s,r]=$e("new-project","mode","brd"),[i,a,l]=$e("new-project","name",""),[c,u,h]=$e("new-project","idea",""),[m,p,x]=$e("new-project","paste",!1),[g,j,k]=$e("new-project","text",""),[b,w]=N.useState(null),[S,T]=N.useState(!!i.trim()),[E,z]=N.useState(null),[$,P]=N.useState(!1),[L,W]=N.useState(!1),[F,U]=N.useState(null),I=Kg(),D=I.listing.data,M=E??D?.place??"",Y=async B=>{const ee=B?[...B][0]:void 0;if(ee){U(null);try{const O=await a4(ee);w(O),S||a(Af(ee.name))}catch(O){U(O.message)}}},ae=n==="idea"?c.trim():m?g.trim():b,H=!!(i.trim()&&ae&&M&&!L),Z=Me(i.trim()||"Your project"),ue=n==="idea"?`squad projects --new ${Z} --idea ${Me(c.trim()&&c.trim().length<=60?c.trim():"<what you want to build>")}`:`squad projects --new ${Z} --brd ${Me(b?.name??"<file>")}`,q=async()=>{W(!0),U(null);try{const B={name:i.trim(),where:M,...n==="idea"?{idea:c}:m?{text:g}:{file:{name:b.name,data:b.data}}},ee=await et("/api/v1/app/projects/new","POST",B);for(const O of[r,l,h,x,k])O();window.location.assign(ee.url.replace(/\/board$/,ee.opens))}catch(B){W(!1),U(B instanceof Error?B.message:String(B))}};return t.jsxs(Ye,{title:"New project",wide:!0,onClose:e,losing:n==="brd"&&b?`the file ${b.name}`:null,footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:!H,onClick:()=>void q(),children:L?"Creating…":"Create my project"}),t.jsx("button",{className:"btn",onClick:e,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:ue})]}),children:[t.jsx("p",{children:"Tell your squad what you want. It sets everything else up."}),t.jsxs("div",{className:"np",children:[t.jsxs("div",{className:"seg",role:"group","aria-label":"What you have",children:[t.jsx("button",{className:n==="brd"?"on":"","aria-pressed":n==="brd",onClick:()=>s("brd"),children:"I have a BRD"}),t.jsx("button",{className:n==="idea"?"on":"","aria-pressed":n==="idea",onClick:()=>s("idea"),children:"I have an idea"})]}),n==="idea"?t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"np-idea",children:"What do you want to build?"}),t.jsx("textarea",{id:"np-idea",className:"textarea",dir:je(c),autoFocus:!0,rows:4,value:c,onChange:B=>u(B.target.value),placeholder:"In your own words, in Arabic or English. Who will use it, and what will they do?"})]}):m?t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"np-paste",children:"The BRD's text"}),t.jsx("textarea",{id:"np-paste",className:"textarea rq-pastebox",dir:je(g),autoFocus:!0,value:g,onChange:B=>j(B.target.value),placeholder:"Paste the whole document here. Headings help the Analyst find its parts."}),t.jsxs("div",{className:"rq-hint",children:["Have the file?"," ",t.jsx("button",{className:"rq-link",onClick:()=>p(!1),children:"Choose a file instead"})]})]}):t.jsxs(t.Fragment,{children:[t.jsx(o4,{file:b,onPick:B=>void Y(B),onClear:()=>w(null),hint:"Word or PDF, in Arabic or English. The Analyst reads it and asks only about real gaps."}),t.jsxs("div",{className:"rq-hint",children:["No file?"," ",t.jsx("button",{className:"rq-link",onClick:()=>p(!0),children:"Paste the text instead"})]})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"np-name",children:"Project name"}),t.jsx("input",{id:"np-name",className:"input",dir:je(i),value:i,placeholder:"Visitor log",onChange:B=>{a(B.target.value),T(!0),U(null)}})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{children:"Where it goes"}),$?t.jsxs(t.Fragment,{children:[t.jsx(Vg,{at:I.at,go:B=>{U(null),I.setAt(B)},listing:I.listing,onError:U}),D?.notHere&&t.jsx("p",{className:"fb-error",children:D.notHere}),t.jsxs("div",{className:"np-pick",children:[t.jsx("button",{className:"btn sm pri",disabled:!D||!!D.notHere,onClick:()=>{z(D.path),P(!1)},children:"Put it here"}),t.jsx("button",{className:"btn sm",onClick:()=>P(!1),children:"Cancel"})]})]}):t.jsxs("div",{className:"np-where",children:[t.jsx("span",{className:"grow",dir:"auto",children:M?IW(M,D?.home,i.trim()):"…"}),t.jsx("button",{className:"btn sm",disabled:!M,onClick:()=>{I.setAt(M),P(!0)},children:"Change"})]})]}),t.jsx("p",{className:"note",children:"squad-kit makes the folder for you. Nothing leaves your computer except what your AI tool reads."}),F&&t.jsx("p",{className:"fb-error",children:F})]})]})}const ji={en:{other:"العربية",head:"Meet your engineering squad.",sub:"Five specialists turn your idea into working software. They do the technical work. You make the decisions.",squad:[["Analyst","Understands what you need"],["Architect","Plans how to build it"],["Builder","Writes the code"],["Reviewer","Checks the work"],["Tester","Shows you the proof"]],you:"You",youDo:"Say if it looks right",go:"Get started",note:"It takes about 2 minutes to get ready.",readyHead:"Is your computer ready?",readySub:"squad-kit checks this by itself. If something is missing, you get one clear step.",git:"Git",gitOk:"It keeps every version of your work safe.",tool:"Your AI tool",toolOk:e=>`${e} is ready.`,browser:"The screenshot browser",browserOk:"squad-kit sets it up by itself the first time it is needed.",checking:"Checking your computer…",goOn:"Continue",allSet:"All set. You can change these later in Settings.",oneLeft:"One step left.",anyway:"Continue anyway",steps:{"install-git":"Git is not on this computer. Install it, then come back here.","update-git":"Git is too old for squad-kit. Update it to 2.38 or newer, then come back here.","install-tool":"Your squad needs an AI tool. Open a terminal and install Claude Code with this line, then come back here.","sign-in":e=>`${e??"Your AI tool"} is here. Sign in once and your squad can work: open a terminal, run this line, and follow what it says.`},download:"Get Git",copy:"Copy",startHead:"What do you have?",newHead:"A BRD or an idea",newBody:"Start a new project from nothing. You don't need a folder, code, or any technical knowledge.",newGo:"New project",addHead:"A project I already have",addBody:"Pick its folder. Your squad reads it first, and nothing changes until you approve.",showHead:"Just show me",showBody:"Watch a sample project being built. No AI runs, and it costs nothing.",showing:"Opening the sample project…",back:"Back"},ar:{other:"English",head:"تعرّف على فريقك الهندسي.",sub:"خمسة متخصصين يحوّلون فكرتك إلى برنامج يعمل. هم يتولون العمل التقني، وأنت تتخذ القرارات.",squad:[["المحلل","يفهم ما تحتاجه"],["المهندس","يخطط لطريقة البناء"],["المطوّر","يكتب الكود"],["المراجع","يفحص العمل"],["المختبِر","يعرض لك الدليل"]],you:"أنت",youDo:"تقرر إن كان مناسبًا",go:"لنبدأ",note:"يستغرق التجهيز نحو دقيقتين.",readyHead:"هل جهازك جاهز؟",readySub:"يتحقق squad-kit من ذلك بنفسه. وإن نقص شيء، تحصل على خطوة واحدة واضحة.",git:"Git",gitOk:"يحفظ كل نسخة من عملك بأمان.",tool:"أداة الذكاء الاصطناعي",toolOk:e=>`${e} جاهز.`,browser:"متصفح لقطات الشاشة",browserOk:"يجهّزه squad-kit بنفسه عند أول حاجة إليه.",checking:"جارٍ فحص جهازك…",goOn:"متابعة",allSet:"كل شيء جاهز. يمكنك تغيير هذا لاحقًا من الإعدادات.",oneLeft:"بقيت خطوة واحدة.",anyway:"متابعة على أي حال",steps:{"install-git":"Git غير موجود على هذا الجهاز. ثبّته ثم عد إلى هنا.","update-git":"نسخة Git قديمة بالنسبة إلى squad-kit. حدّثها إلى 2.38 أو أحدث ثم عد إلى هنا.","install-tool":"يحتاج فريقك إلى أداة ذكاء اصطناعي. افتح نافذة الأوامر وثبّت Claude Code بهذا السطر، ثم عد إلى هنا.","sign-in":e=>`${e??"أداة الذكاء الاصطناعي"} موجودة. سجّل الدخول مرة واحدة ليعمل فريقك: افتح نافذة الأوامر، وشغّل هذا السطر، واتبع ما يطلبه.`},download:"تنزيل Git",copy:"نسخ",startHead:"ماذا لديك؟",newHead:"وثيقة متطلبات أو فكرة",newBody:"ابدأ مشروعًا جديدًا من الصفر. لا تحتاج إلى مجلد أو كود أو خبرة تقنية.",newGo:"مشروع جديد",addHead:"مشروع لديّ بالفعل",addBody:"اختر مجلده. يقرؤه فريقك أولًا، ولا يتغير شيء حتى توافق.",showHead:"أرني فقط",showBody:"شاهد بناء مشروع تجريبي. بلا ذكاء اصطناعي وبلا تكلفة.",showing:"جارٍ فتح المشروع التجريبي…",back:"رجوع"}},FW=[{icon:wi,color:"#2f6fd0"},{icon:a1,color:"#6a4fc2"},{icon:Yv,color:"#b4590f"},{icon:Pa,color:"#0e6f7a"},{icon:d1,color:"var(--accent)"}];async function Q5(){const e=await et("/api/v1/app/sample","POST");window.location.assign(e.url)}function LW({step:e,onStep:n,onNew:s,onAdd:r}){const[i,a]=N.useState(Br),l=ji[i],c=()=>{const h=i==="ar"?"en":"ar";eC(h),a(h)},u=()=>{n("ready"),et("/api/v1/app/settings","PUT",{welcomed:!0}).catch(()=>{})};return t.jsx("div",{className:"wl",dir:i==="ar"?"rtl":"ltr",lang:i,children:t.jsxs("div",{className:"wl-in",children:[t.jsxs("div",{className:"wl-top",children:[t.jsxs("div",{className:"wl-logo",dir:"ltr",children:[t.jsx("img",{src:"/logo.svg",alt:""}),t.jsx("span",{children:"squad-kit"})]}),t.jsx("button",{className:"wl-lang",onClick:c,children:l.other})]}),e==="welcome"&&t.jsx(zW,{lang:i,onGo:u}),e==="ready"&&t.jsx(_W,{lang:i,onGo:()=>n("start")}),e==="start"&&t.jsx(DW,{lang:i,onNew:s,onAdd:r,onBack:()=>n("ready")})]})})}function zW({lang:e,onGo:n}){const s=ji[e];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"wl-main wl-main-wide",children:[t.jsx("h1",{className:"wl-big",children:s.head}),t.jsx("p",{className:"wl-sub",children:s.sub}),t.jsxs("div",{className:"wl-squad",children:[t.jsx("div",{className:"wl-wire","aria-hidden":"true"}),s.squad.map(([r,i],a)=>{const{icon:l,color:c}=FW[a];return t.jsxs("div",{className:"wl-tile",style:{"--d":`${.1+a*.35}s`},children:[t.jsx("div",{className:"wl-mark",style:{color:c},children:t.jsx(l,{size:24,"aria-hidden":"true"})}),t.jsx("b",{children:r}),t.jsx("span",{children:i})]},r)}),t.jsxs("div",{className:"wl-tile",style:{"--d":"1.95s"},children:[t.jsx("div",{className:"wl-mark wl-mark-you",children:t.jsx(u1,{size:24,"aria-hidden":"true"})}),t.jsx("b",{className:"wl-you",children:s.you}),t.jsx("span",{children:s.youDo})]})]})]}),t.jsxs("div",{className:"wl-go wl-go-wide",children:[t.jsx("button",{className:"wl-cta",onClick:n,children:s.go}),t.jsx("span",{children:s.note})]})]})}function MW({text:e,copy:n}){return t.jsxs("span",{className:"wl-cmd",children:[t.jsx("span",{children:e}),t.jsx("button",{"aria-label":n,title:n,onClick:()=>void navigator.clipboard?.writeText(e).catch(()=>{}),children:t.jsx(Mn,{size:14})})]})}const OW={"install-tool":"npm install -g @anthropic-ai/claude-code","sign-in":"claude"};function zk({lang:e,step:n,label:s}){const r=ji[e],i=r.steps[n],a=OW[n];return t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"wl-line",children:typeof i=="function"?i(s):i}),t.jsxs("span",{className:"wl-step",children:[a&&t.jsx(MW,{text:a,copy:r.copy}),(n==="install-git"||n==="update-git")&&t.jsx("a",{className:"wl-act",href:"https://git-scm.com/downloads",target:"_blank",rel:"noreferrer",children:r.download})]})]})}function Am({state:e}){return e==="wait"?t.jsx("span",{className:"wl-tick wl-tick-wait",children:t.jsx(Xe,{size:20,className:"spin",role:"img","aria-label":"Checking"})}):e==="needs"?t.jsx("span",{className:"wl-tick wl-tick-needs",children:t.jsx(Fn,{size:16,strokeWidth:2.5,role:"img","aria-label":"Needs one step"})}):t.jsx("span",{className:"wl-tick",children:t.jsx(ce,{size:15,strokeWidth:3,role:"img","aria-label":"Ready"})})}function _W({lang:e,onGo:n}){const s=ji[e],r=ve({queryKey:["app","ready"],queryFn:()=>ye("/api/v1/app/ready"),refetchInterval:l=>l.state.data?.git.ok&&l.state.data?.tool.ok?!1:3e3}),i=r.data,a=!!(i?.git.ok&&i?.tool.ok);return t.jsxs("div",{className:"wl-main wl-main-narrow",children:[t.jsx("h1",{children:s.readyHead}),t.jsx("p",{className:"wl-sub wl-sub-tight",children:s.readySub}),t.jsxs("div",{className:"wl-rows","aria-live":"polite",children:[t.jsxs("div",{className:"wl-row",children:[t.jsx(Am,{state:i?i.git.ok?"ok":"needs":"wait"}),t.jsxs("div",{children:[t.jsx("b",{children:s.git}),i?i.git.step?t.jsx(zk,{lang:e,step:i.git.step}):t.jsx("span",{className:"wl-line",children:s.gitOk}):t.jsx("span",{className:"wl-line",children:s.checking})]})]}),t.jsxs("div",{className:"wl-row",children:[t.jsx(Am,{state:i?i.tool.ok?"ok":"needs":"wait"}),t.jsxs("div",{children:[t.jsx("b",{children:s.tool}),i?i.tool.step?t.jsx(zk,{lang:e,step:i.tool.step,label:i.tool.label}):t.jsx("span",{className:"wl-line",children:s.toolOk(i.tool.label??"")}):t.jsx("span",{className:"wl-line",children:s.checking})]})]}),t.jsxs("div",{className:"wl-row",children:[t.jsx(Am,{state:i?"ok":"wait"}),t.jsxs("div",{children:[t.jsx("b",{children:s.browser}),t.jsx("span",{className:"wl-line",children:s.browserOk})]})]})]}),t.jsxs("div",{className:"wl-go",style:{marginTop:32},children:[t.jsx("button",{className:"wl-cta",disabled:!a,onClick:n,children:s.goOn}),t.jsx("span",{children:a?s.allSet:i?s.oneLeft:s.checking}),i&&!a||r.isError?t.jsx("button",{className:"wl-quiet",onClick:n,children:s.anyway}):null]})]})}function DW({lang:e,onNew:n,onAdd:s,onBack:r}){const i=ji[e],[a,l]=N.useState(!1),[c,u]=N.useState(""),h=async()=>{l(!0),u("");try{await Q5()}catch(m){l(!1),u(m instanceof Error?m.message:String(m))}};return t.jsxs("div",{className:"wl-main wl-main-mid",children:[t.jsx("h1",{style:{marginBottom:32},children:i.startHead}),t.jsxs("div",{className:"wl-cards",children:[t.jsxs("button",{className:"wl-card wl-card-main",onClick:n,children:[t.jsx(Dr,{size:36,strokeWidth:1.8,"aria-hidden":"true"}),t.jsx("span",{className:"wl-fill"}),t.jsx("b",{children:i.newHead}),t.jsx("span",{children:i.newBody}),t.jsx("i",{children:i.newGo})]}),t.jsxs("button",{className:"wl-card wl-card-side",onClick:s,children:[t.jsx(o1,{size:28,"aria-hidden":"true"}),t.jsx("span",{className:"wl-fill"}),t.jsx("b",{children:i.addHead}),t.jsx("span",{children:i.addBody})]}),t.jsxs("button",{className:"wl-card wl-card-side",disabled:a,onClick:()=>void h(),children:[t.jsx(kn,{size:28,"aria-hidden":"true"}),t.jsx("span",{className:"wl-fill"}),t.jsx("b",{children:i.showHead}),t.jsx("span",{children:a?i.showing:i.showBody})]})]}),c&&t.jsx("p",{className:"wl-err",role:"alert",children:c}),t.jsx("div",{className:"wl-go",style:{marginTop:20},children:t.jsx("button",{className:"wl-quiet",onClick:r,children:i.back})})]})}function BW(){const[e,n]=N.useState(!1),[s,r]=N.useState("");return t.jsxs("button",{className:"home-empty",disabled:e,onClick:()=>{n(!0),r(""),Q5().catch(i=>{n(!1),r(i instanceof Error?i.message:String(i))})},children:[t.jsx(kn,{size:22}),t.jsx("b",{children:"Just show me"}),t.jsx("span",{role:s?"alert":void 0,children:s||(e?ji.en.showing:ji.en.showBody)})]})}const Mk=2e3,Ok=e=>`/p/${encodeURIComponent(e)}`;function WW(e,n){const s=Ci(n);return e.replace(/\bsquad ([a-z-]+) (\S+)/g,(r,i,a)=>`squad ${i} ${a} --project ${s}`)}function UW(e,n){return n&&e.startsWith(n)?`~${e.slice(n.length)}`:e}function HW(){const{theme:e,toggleTheme:n}=Le(),s=ve({queryKey:["app","projects"],queryFn:()=>ye("/api/v1/app/projects"),refetchInterval:Mk}),r=ve({queryKey:["app","waiting"],queryFn:()=>ye("/api/v1/app/waiting"),refetchInterval:Mk}),[i,a]=N.useState(!1),[l,c]=N.useState(!1),[u,h]=N.useState(null),m=s.data?.projects??[],p=r.data?.items??[],x=g4(),g=p.length+x.length,[j,k]=N.useState(null),b=!!s.data&&m.length===0&&!s.data?.welcomed,w=j??(b?"welcome":null);return w?t.jsxs(t.Fragment,{children:[t.jsx(LW,{step:w,onStep:k,onNew:()=>c(!0),onAdd:()=>a(!0)}),i&&t.jsx(_k,{onClose:()=>a(!1)}),l&&t.jsx(Lk,{onClose:()=>c(!1)})]}):t.jsxs("div",{className:"home",children:[t.jsxs("header",{className:"home-top",children:[t.jsx("img",{src:"/logo.svg",alt:""}),t.jsx("b",{children:"squad-kit"}),t.jsx("span",{className:"grow"}),s.data&&t.jsx(KW,{s:s.data}),t.jsx(JS,{}),t.jsx("button",{className:"theme",onClick:n,"aria-label":e==="light"?"Switch to dark":"Switch to light",children:e==="light"?t.jsx(wl,{size:15}):t.jsx(Sl,{size:15})})]}),t.jsx(wb,{}),t.jsx(Ff,{}),t.jsx(If,{}),t.jsx(uM,{}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page home-page",children:[t.jsxs("section",{className:"home-projects",children:[t.jsxs("div",{className:"home-h",children:[t.jsx("h2",{children:"Projects"}),t.jsx("span",{className:"grow"}),t.jsxs("button",{className:"btn",onClick:()=>a(!0),children:[t.jsx(Gm,{size:15})," Add project"]}),t.jsxs("button",{className:"btn pri",onClick:()=>c(!0),children:[t.jsx(jt,{size:15})," New project"]})]}),s.isLoading?null:s.isError&&!s.data?t.jsx(ys,{what:"your projects",error:s.error,onRetry:()=>void s.refetch()}):m.length===0?t.jsxs("div",{className:"home-starts",children:[t.jsxs("button",{className:"home-empty",onClick:()=>c(!0),children:[t.jsx(zo,{size:22}),t.jsx("b",{children:"Start a new project"}),t.jsx("span",{children:"You have a BRD or an idea. You don't need a folder, code or any technical knowledge."})]}),t.jsxs("button",{className:"home-empty",onClick:()=>a(!0),children:[t.jsx(Gm,{size:22}),t.jsx("b",{children:"Add a project you already have"}),t.jsx("span",{children:"Pick its folder: one repo, or a folder with several repos."})]}),t.jsx(BW,{})]}):t.jsx("div",{className:"pcards",children:m.map(S=>t.jsx(VW,{p:S,onRemove:()=>h(S)},S.id))}),t.jsx("div",{className:"home-cmd",children:t.jsx(X,{text:"squad projects"})})]}),t.jsxs("section",{className:"home-inbox",id:"waiting",children:[t.jsxs("div",{className:"home-h",children:[t.jsx("h2",{children:"Waiting for you"}),g>0&&t.jsx("span",{className:"badge you",children:g}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:"squad inbox"})]}),r.isError&&!r.data?t.jsx(ys,{what:"what waits for you",error:r.error,onRetry:()=>void r.refetch()}):g===0?t.jsxs("div",{className:"calm",children:[t.jsx("span",{className:"ring",children:t.jsx(ce,{size:18,strokeWidth:2.5})}),t.jsxs("div",{children:[t.jsx("b",{children:"Nothing needs you right now"}),t.jsx("span",{children:m.length?"The squads are working. Questions, plans, proof and decisions from every project land here.":"Start a project to begin."})]})]}):t.jsxs("div",{className:"home-waiting",children:[x.map(S=>t.jsx(y4,{w:S},`${S.project?.id??""}/${S.id}`)),p.map(({project:S,ticket:T})=>t.jsxs("div",{className:"wcard",children:[t.jsxs("div",{className:"grow",children:[t.jsxs("div",{className:"meta",children:[t.jsx("span",{className:"pill sm",children:S.name}),t.jsx("span",{className:"id",children:T.id}),t.jsx("span",{children:er[T.stage]}),t.jsx("span",{children:st(T.activity[0]?.at??T.createdAt)})]}),t.jsx(R,{as:"h3",text:T.title}),t.jsx(R,{as:"p",text:T.waiting?.summary??(Xs(T)?`Change ${Si(T).id} to the spec waits for you`:Rs(T)?j1(T):T.outdated?.length?x1(T):`Looks stuck: ${T.quiet?.detail??""}`)})]}),t.jsx(X,{text:WW(g1(T),S.name)}),t.jsx("a",{className:"btn pri sm",href:T.waiting?.kind==="proof"?`${Ok(S.id)}/tickets/${encodeURIComponent(T.id)}/proof`:`${Ok(S.id)}/board?ticket=${encodeURIComponent(T.id)}`,children:T.waiting?zd(T):"Check it"})]},`${S.id}/${T.id}`))]})]})]})}),i&&t.jsx(_k,{onClose:()=>a(!1)}),l&&t.jsx(Lk,{onClose:()=>c(!1)}),u&&t.jsx(QW,{p:u,onClose:()=>h(null)})]})}function KW({s:e}){const n=Ot(),{toast:s}=Le(),r=async i=>{try{await et("/api/v1/app/settings","PUT",{parallel:i}),n.invalidateQueries({queryKey:["app"]}),s(`Up to ${i} tickets at once, across all projects`)}catch(a){s(a instanceof Error?a.message:String(a),"err")}};return t.jsxs("label",{className:"shared",title:"Shared by all your projects, because they use the same AI accounts",children:[t.jsxs("span",{children:["Tickets at once: ",t.jsx("b",{children:e.running})," of"]}),t.jsx("select",{className:"select sm",value:e.parallel,onChange:i=>void r(Number(i.target.value)),"aria-label":"Tickets at once, across all projects",children:Array.from({length:e.max},(i,a)=>a+1).map(i=>t.jsx("option",{value:i,children:i},i))})]})}function VW({p:e,onRemove:n}){const s=Ot(),{toast:r}=Le(),[i,a]=N.useState(!1),l=e.setup&&e.setup.status!=="done"?e.setup:null,c=e.open&&e.tickets===0?e.setup?.brd:void 0,u=async()=>{a(!0);try{await et("/api/v1/app/projects","POST",{folder:e.root}),r(`${e.name} is open`)}catch(m){r(m instanceof Error?m.message:String(m),"err")}finally{a(!1),s.invalidateQueries({queryKey:["app"]})}},h=e.open?e.setup?.ready&&!e.setup.approved?t.jsx("span",{className:"you",children:e.setup.line??"Your project overview is ready to check"}):e.setup?.line&&!e.setup.approved?t.jsx("span",{className:e.setup.status==="failed"?"bad":"you",children:e.setup.line}):l?.status==="failed"?t.jsx("span",{className:"bad",children:"The Architect could not read the project"}):c?t.jsx("span",{className:"you",children:"Your stories start from your BRD"}):l?t.jsxs("span",{className:"you",children:["Setting up: ",l.status==="running"?l.now??"the Architect reads the project":"the Architect reads the project next"]}):t.jsxs("span",{children:[e.tickets," open",e.working>0&&t.jsxs(t.Fragment,{children:[" · ",e.working," working"]}),e.waiting>0&&t.jsxs("span",{className:"you",children:[" · ",e.waiting," waiting for you"]})]}):t.jsxs("span",{className:"bad",children:["Could not open: ",e.why]});return t.jsxs("div",{className:`pcard ${e.open?"":"off"}`,children:[t.jsx("span",{className:"pm",children:e.name.charAt(0).toUpperCase()}),t.jsxs("div",{className:"grow",children:[t.jsxs("b",{children:[t.jsx(R,{text:e.name}),e.engine==="demo"&&t.jsx("small",{className:"demo",children:"Demo"})]}),t.jsx("span",{className:"mono path",title:e.root,children:e.root}),t.jsx("span",{className:"state",children:h})]}),t.jsxs("div",{className:"acts",children:[e.open?t.jsx("a",{className:"btn sm pri",href:c?e.url.replace(/\/board$/,`/requirements/${encodeURIComponent(c.id)}`):e.setup?.line&&!e.setup.approved?e.url.replace(/\/board$/,e.setup.ready?"/overview":"/setup"):e.url,children:c?"Open the BRD":e.setup?.line&&!e.setup.approved?e.setup.ready?"Check it":"See the setup":"Open board"}):t.jsx("button",{className:"btn sm",disabled:i,onClick:()=>void u(),children:"Try again"}),t.jsx("button",{className:"btn sm quiet",onClick:n,children:"Remove"})]})]})}const YW=[{kind:"empty",name:"An empty folder",text:"Start from an idea: squad-kit asks what you want to build."},{kind:"older",name:"An older squad-kit",text:"Your specs, plans and decisions stay where they are. squad-kit adds its own files beside them."},{kind:"repos",name:"Several code folders",text:"squad-kit reads each one and shows you how they fit together."}];function GW({look:e,looking:n}){return n?t.jsx("p",{className:"note","aria-live":"polite",children:"Looking at what is in this folder…"}):e?e.ask?t.jsx("div",{className:"ob-found","aria-live":"polite",children:t.jsxs("div",{className:"ob-found-c",role:"alert",children:[t.jsx("b",{children:e.title}),t.jsx("div",{children:e.found}),t.jsx("div",{className:"note",children:e.next})]})}):t.jsxs("div",{className:"ob-found","aria-live":"polite",children:[t.jsxs("div",{className:"ob-found-c",children:[t.jsx("b",{children:e.title}),t.jsx("div",{children:e.found}),t.jsx("div",{children:e.next}),t.jsx("div",{className:"note",children:e.safe})]}),t.jsxs("div",{className:"ob-also",children:[t.jsx("div",{className:"ob-k",children:"squad-kit also handles"}),YW.filter(s=>s.kind!==e.kind).slice(0,2).map(s=>t.jsxs("div",{className:"ob-also-r",children:[t.jsx("b",{children:s.name}),t.jsx("span",{children:s.text})]},s.kind))]}),t.jsx("div",{className:"note",children:e.takes})]}):null}function _k({onClose:e}){const{at:n,setAt:s,listing:r}=Kg(),[i,a]=N.useState(null),[l,c]=N.useState(!1),u=r.data,h=tW(u),m=g=>{a(null),s(g)},p=h.data?.ask,x=async g=>{if(u){c(!0),a(null);try{const j=await et("/api/v1/app/projects","POST",{folder:u.path,...g?{choice:g}:{}}),k=j.setup&&!j.setup.ready&&!j.setup.approved&&j.setup.line;window.location.assign(k?j.url.replace(/\/board$/,"/setup"):j.url)}catch(j){c(!1),a(j instanceof Error?j.message:String(j))}}};return t.jsxs(Ye,{title:"Add a project",wide:!0,onClose:e,footer:t.jsxs(t.Fragment,{children:[p?t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn pri",disabled:l||r.isFetching,onClick:()=>void x("above"),children:l?"Adding…":p.kind==="inside-repo"?`Add ${p.name} instead`:`Open ${p.name}`}),p.kind==="inside-project"&&t.jsx("button",{className:"btn",disabled:l||r.isFetching,onClick:()=>void x("here"),children:"Add this folder on its own"})]}):t.jsx("button",{className:"btn pri",disabled:!u?.canAdd||l||r.isFetching||h.isFetching,onClick:()=>void x(),children:l?"Adding…":u?.kind==="project"?"Open it":"Add and get to know it"}),t.jsx("button",{className:"btn",onClick:e,children:"Cancel"}),t.jsx("span",{className:"grow"}),u&&t.jsx(X,{text:`cd ${Me(p?.root??u.path)} && squad console`})]}),children:[t.jsx("p",{className:"note",children:"Pick the project's folder: one with its code, one that holds several code folders, or a new, empty folder for a new project."}),t.jsx(Vg,{at:n,go:m,listing:r,onError:a}),u&&t.jsxs("p",{className:"fb-kind",children:[t.jsx("b",{children:UW(u.path,u.home)}),!u.canAdd&&t.jsx("span",{children:"This folder can't be a project. Open a folder inside it, or make a new one here."})]}),u?.canAdd&&t.jsx(GW,{look:h.data,looking:h.isFetching}),i&&t.jsx("p",{className:"fb-error",children:i})]})}function QW({p:e,onClose:n}){const s=Ot(),{toast:r}=Le(),[i,a]=N.useState(!1),l=async()=>{a(!0);try{await et(`/api/v1/app/projects/${encodeURIComponent(e.id)}`,"DELETE"),s.invalidateQueries({queryKey:["app"]}),r(`${e.name} is out of squad-kit. Its files stay in its folder.`),n()}catch(u){a(!1),r(u instanceof Error?u.message:String(u),"err")}},c=/\s/.test(e.name)?`"${e.name}"`:e.name;return t.jsx(Ye,{title:`Take ${e.name} out of squad-kit?`,onClose:n,footer:t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn danger",disabled:i,onClick:()=>void l(),children:"Take it out"}),t.jsx("button",{className:"btn",onClick:n,children:"Cancel"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:`squad projects --remove ${c}`})]}),children:t.jsxs("p",{children:["Its squad stops. Nothing is deleted: its files stay in ",t.jsx("span",{className:"mono",children:e.root}),". Add it again any time."]})})}function ZW(){const e=De(),n=re(),[s,r]=N.useState(!1),[i,a]=N.useState(""),[l,c]=N.useState("analyst"),u=(e.data?.ready?e.data.tickets:[]).filter(m=>!m.chat?.open&&!m.takenOver),h=()=>n.mutate({path:`/api/v1/tickets/${i}/chat/start`,body:{with:l}},{onSuccess:()=>{r(!1),Nt.open(i)}});return t.jsxs("span",{className:"cmenu-w",children:[t.jsx("button",{className:"iconbtn",onClick:()=>r(!s),"aria-label":"Start a new conversation",title:"Start a new conversation","aria-expanded":s,children:t.jsx(jt,{size:16})}),s&&t.jsxs("div",{className:"cmenu cnew",role:"dialog","aria-label":"Start a new conversation",children:[t.jsxs("label",{children:[t.jsx("span",{children:"Ticket"}),t.jsxs("select",{className:"input",value:i,onChange:m=>a(m.target.value),children:[t.jsx("option",{value:"",children:"Pick a ticket"}),u.map(m=>t.jsxs("option",{value:m.id,children:[m.id," · ",es(m.title)]},m.id))]})]}),t.jsxs("label",{children:[t.jsx("span",{children:"Talk to"}),t.jsx("select",{className:"input",value:l,onChange:m=>c(m.target.value),children:Object.keys(ct).map(m=>t.jsxs("option",{value:m,children:["The ",ct[m]]},m))})]}),t.jsxs("div",{className:"cbtns",children:[t.jsx("button",{className:"btn pri sm",disabled:!i||n.isPending,onClick:h,children:"Start talking"}),t.jsx("button",{className:"btn sm",onClick:()=>r(!1),children:"Cancel"})]})]})]})}function XW(){const e=_r({from:"/conversations"}),n=_t({from:"/conversations"}),s=Ia(wu),[r,i]=N.useState(""),a=Jd(r),c=Jd().data??[],u=e.ticket??c.find(g=>g.open)?.id??c[0]?.id,[h,m]=N.useState(null),p=g=>{m(null),n({search:{ticket:g}})},x=g=>{Nt.open(g),n({to:"/board"})};return bg(u??null,()=>vg(document.querySelector(".ccenter, .cphone"))),s?t.jsx(iU,{id:u,all:c,pick:p,doc:h,setDoc:m}):t.jsxs("div",{className:"cpage",children:[t.jsx(JW,{q:r,setQ:i}),t.jsxs("div",{className:"cpage-b",children:[t.jsx(tU,{list:a.data??[],id:u,pick:p,searching:!!r.trim()}),t.jsx("section",{className:"ccenter","aria-label":"Conversation",children:u?t.jsx(zu,{id:u,size:"full",onOpenDoc:m,onPanel:()=>x(u)},u):t.jsxs("div",{className:"cempty",children:[t.jsx("p",{children:"No talks yet. Start one with any agent on any ticket."}),t.jsx(ZW,{})]})}),h?t.jsx(Iu,{doc:h,onClose:()=>m(null)}):u?t.jsx(nU,{id:u,onOpenDoc:m}):null]})]})}function JW({q:e,setQ:n}){const s=De(),{theme:r,toggleTheme:i}=Le(),a=s.data?.ready?s.data.meta.project:"";return t.jsxs("header",{className:"cpage-h",children:[t.jsxs(ge,{to:"/board",className:"btn",children:[t.jsx(Uv,{size:15})," Back to the board"]}),t.jsx("h1",{children:"Conversations"}),t.jsx("span",{className:"cdim",children:a}),t.jsx("span",{className:"grow"}),t.jsxs("label",{className:"search cpage-search",children:[t.jsx(wi,{size:15}),t.jsx("input",{value:e,onChange:l=>n(l.target.value),placeholder:"Search all conversations","aria-label":"Search all conversations",dir:je(e)})]}),t.jsx("button",{className:"iconbtn",onClick:i,"aria-label":r==="light"?"Switch to dark":"Switch to light",children:r==="light"?t.jsx(wl,{size:16}):t.jsx(Sl,{size:16})})]})}function Z5(e){return new Date(e).toDateString()===new Date().toDateString()?tn(e):Ls(e)}function eU(e){const s=(e.match??e.last?.text??"").replace(/[*_`#>]+/g,"").replace(/\s+/g," ").trim(),r=tt(s);return{text:`${e.last?.who==="you"&&!e.match?"You: ":""}${s}`,dir:r.dir,cls:Fs(r)}}function tU({list:e,id:n,pick:s,searching:r}){const i=bu(),a=[["Waiting for you",e.filter(l=>l.open&&l.yourTurn)],["Talking now",e.filter(l=>l.open&&!l.yourTurn)],["Earlier",e.filter(l=>!l.open)]];return t.jsx("nav",{className:"clist","aria-label":"All conversations",children:t.jsxs("div",{className:"clist-s",children:[r&&!e.length&&t.jsx("p",{className:"cdim",style:{padding:"14px 18px"},children:"Nothing found."}),a.map(([l,c])=>c.length?t.jsxs("div",{children:[t.jsx("div",{className:"csec",children:l}),c.map(u=>{const h=u.id===n,m=eU(u),p=wg(u,i.seen);return t.jsxs("button",{className:`crow-i ${h?"on":""}`,onClick:()=>s(u.id),"aria-current":h,children:[t.jsx(ms,{role:u.with,live:u.thinking}),t.jsxs("span",{className:"rt",children:[t.jsx("span",{className:"cid",children:u.id}),t.jsx("b",{children:ct[u.with]}),u.yourTurn&&t.jsx("span",{className:"cwait",children:"Your turn"})]}),t.jsx("span",{className:"rtime",children:u.thinking?"now":Z5(u.at)}),t.jsx("span",{className:`rp ${u.thinking?"t-en":m.cls}`,dir:u.thinking?"ltr":m.dir,children:u.thinking?t.jsxs("span",{className:`rtyping c-${u.with}`,children:[t.jsxs("span",{className:"cdots sm",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]}),t.jsx("span",{className:"shim",children:"Writing"})]}):t.jsx(Jt,{text:m.text||u.title,dir:m.dir})}),p>0&&!h&&t.jsx("span",{className:"cbadge rb",children:p})]},u.id)})]},l):null)]})})}function nU({id:e,onOpenDoc:n}){const s=qa(e).data,[r,i]=N.useState("spec");if(!s)return t.jsx("aside",{className:"cspec"});const a=[...new Set([...(s.chat?.messages??[]).flatMap(l=>l.files??[]),...s.attachments??[]])];return t.jsxs("aside",{className:"cspec","aria-label":"The ticket's spec",children:[t.jsxs("div",{className:"cstabs",role:"tablist",children:[t.jsx("button",{className:`cstab ${r==="spec"?"on":""}`,role:"tab","aria-selected":r==="spec",onClick:()=>i("spec"),children:s.chat?.open&&!s.chat.beside&&s.chat.with==="analyst"?"Spec draft":"Spec"}),t.jsxs("button",{className:`cstab ${r==="files"?"on":""}`,role:"tab","aria-selected":r==="files",onClick:()=>i("files"),children:["Files · ",a.length]}),t.jsx("button",{className:`cstab ${r==="activity"?"on":""}`,role:"tab","aria-selected":r==="activity",onClick:()=>i("activity"),children:"Activity"})]}),t.jsxs("div",{className:"csbody",children:[r==="spec"&&t.jsx(rU,{t:s}),r==="files"&&(a.length?t.jsx(og,{ticket:s.id,files:a,onOpen:n}):t.jsx("p",{className:"cdim",children:"No files yet. Paste or drop screenshots into the chat."})),r==="activity"&&t.jsx("div",{className:"cact-list",children:s.activity.slice(0,60).map((l,c)=>t.jsxs("div",{className:"cact-row",children:[t.jsx("span",{className:"cdim",children:Z5(l.at)}),t.jsxs("span",{children:[t.jsx("b",{children:Zs[l.who]})," ",t.jsx(sU,{text:l.text})]})]},c))})]})]})}function sU({text:e}){const n=tt(e);return t.jsx("span",{dir:n.dir,className:Fs(n),children:t.jsx(Jt,{text:e,dir:n.dir})})}function cd({text:e,fresh:n,chk:s,tone:r}){const i=tt(e);return t.jsxs("div",{className:`citem ${n?"new":""} ${r??""}`,children:[s&&t.jsx("span",{className:"cchk"}),t.jsx("span",{className:`grow ${Fs(i)}`,dir:i.dir,lang:i.dir==="rtl"?"ar":"en",children:t.jsx(Jt,{text:e,dir:i.dir})}),n&&t.jsx("span",{className:"ctag",children:"From chat"})]})}function rU({t:e}){const n=e.chat?.messages[0]?.at??"",s=e.notes??[],r=p=>!!n&&p>=n,i=e.chat?.open&&!e.chat.beside&&e.chat.with==="analyst",a=[...(e.criteria??[]).map(p=>({text:p.then,at:""})),...(e.brief?.criteria??[]).map(p=>({text:p,at:""})),...s.filter(p=>p.kind==="criterion").map(p=>({text:p.text,at:p.at}))],l=[...(e.brief?.rules??[]).map(p=>({text:p,at:""})),...s.filter(p=>p.kind==="rule").map(p=>({text:p.text,at:p.at}))],c=s.filter(p=>p.kind==="note"&&!p.to),u=(e.questions??[]).filter(p=>!p.answer).map(p=>p.text),h=e.story??e.ask,m=tt(h);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"cdim",children:i?"Grows while you talk. Add to it from any message. The spec is written when you press Write the spec.":"What the squad works from. Add to it from any message with Add to spec."}),t.jsx("h3",{children:"Story"}),t.jsx("div",{className:Fs(m),dir:m.dir,children:t.jsx(Jt,{text:h,dir:m.dir})}),t.jsx("h3",{children:"Done when"}),a.length?a.map((p,x)=>t.jsx(cd,{text:p.text,chk:!0,fresh:r(p.at)},x)):t.jsx("p",{className:"cdim",children:"Nothing yet."}),l.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Rules"}),l.map((p,x)=>t.jsx(cd,{text:p.text,fresh:r(p.at)},x))]}),c.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Notes"}),c.map((p,x)=>t.jsx(cd,{text:p.text,fresh:r(p.at)},x))]}),u.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("h3",{children:"Still open"}),u.map((p,x)=>t.jsx(cd,{text:p,tone:"open"},x))]})]})}function iU({id:e,all:n,pick:s,doc:r,setDoc:i}){const a=qa(e).data,l=bu(),c=_t(),{theme:u,toggleTheme:h}=Le(),m=a?.chat,p=a?Tw(a):null,x=n.filter(j=>j.open||j.id===e),g=N.useRef(null);return N.useEffect(()=>{g.current?.querySelector(".cv.on")?.scrollIntoView({block:"nearest",inline:"nearest"})},[e,x.length]),t.jsxs("div",{className:"cphone",children:[t.jsxs("header",{className:"cph-h",children:[t.jsx("button",{className:"ib",onClick:()=>r?i(null):void c({to:"/board"}),"aria-label":r?"Close the document":"Back to the board",children:t.jsx(Kv,{size:22})}),m&&t.jsx(ms,{role:m.with,live:m.thinking}),t.jsxs("div",{className:"cph-who",children:[t.jsxs("div",{children:[t.jsx("b",{children:m?ct[m.with]:"Conversations"})," ",a&&t.jsx("span",{className:"cid",children:a.id})]}),p&&t.jsx("div",{className:`cph-stage ${p.tone}`,children:p.text})]}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"ib",onClick:h,"aria-label":u==="light"?"Switch to dark":"Switch to light",children:u==="light"?t.jsx(wl,{size:18}):t.jsx(Sl,{size:18})})]}),x.length>1&&t.jsx("div",{className:"cph-convs",role:"tablist","aria-label":"Conversations",ref:g,children:x.map(j=>{const k=j.id===e,b=wg(j,l.seen);return t.jsxs("button",{className:`cv ${k?"on":""}`,role:"tab","aria-selected":k,"aria-label":`${ct[j.with]} on ${j.id}`,onClick:()=>s(j.id),children:[t.jsx(ms,{role:j.with,small:!0}),j.id,j.thinking&&!k&&t.jsxs("span",{className:`cdots sm c-${j.with}`,children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]}),b>0&&!k&&t.jsx("span",{className:"cbadge",children:b})]},j.id)})}),e?t.jsx(zu,{id:e,size:"phone",onOpenDoc:i},e):t.jsx("div",{className:"cempty",children:"No talks yet."}),r&&t.jsx("div",{className:"cph-doc",children:t.jsx(Iu,{doc:r,onClose:()=>i(null)})})]})}function aU(){return ve({queryKey:["overview"],queryFn:()=>ye("/api/v1/overview"),refetchInterval:e=>e.state.data?.talk?.thinking||e.state.data?.handover==="reading"?1e3:3e3})}function oU(e){return e?new Date(e).toDateString()===new Date().toDateString()?`Read today at ${tn(e)}`:`Read on ${Ls(e)}`:""}function lU(){const e=aU(),n=re(),s=_t(),[r,i]=N.useState(!1),[a,l]=N.useState(!1),c=e.data;if(e.isLoading)return t.jsx("div",{className:"center",children:"Loading the overview…"});if(!c)return t.jsx("div",{className:"center",children:"No overview yet."});const u=m=>void s({to:"/board",search:{ticket:m.id}}),h=c.empty&&c.handover==="ready"&&(!c.idea||a);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx(R,{as:"h1",text:c.project}),c.readAt&&!c.empty&&t.jsx("span",{className:"note ob-read",children:oU(c.readAt)}),t.jsx("span",{className:"grow"}),c.handover!=="reading"&&!c.empty&&t.jsxs("button",{className:"btn",disabled:n.isPending,onClick:()=>n.mutate({path:"/api/v1/overview/read-again",done:"The Architect reads the project again"}),children:[t.jsx(xs,{size:14})," Read it again"]}),t.jsx(X,{text:c.command})]}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page ob-page",children:[c.self&&t.jsx(Hg,{title:"squad-kit's own code",text:c.self}),c.handover==="reading"&&t.jsx(X4,{}),h&&t.jsx(cU,{v:c,onSent:()=>l(!1),onWrite:()=>i(!0)}),c.handover==="ready"&&!h&&!c.talk?.open&&t.jsx(dU,{v:c,...c.empty?{onChange:()=>l(!0)}:{}}),c.talk?.open&&t.jsx(uU,{t:c.talk}),c.brd&&t.jsxs("div",{className:"ob-card ready",children:[t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:"Your stories start from your BRD"}),t.jsxs("span",{children:["There is no code yet. The Analyst reads ",t.jsx(R,{text:c.brd.title})," and asks only about real gaps. You approve the stories, then the squad builds them."]})]}),t.jsxs(ge,{to:"/requirements/$id",params:{id:c.brd.id},className:"btn pri",children:["Open the BRD ",t.jsx(xa,{size:15})]})]}),c.handover==="approved"&&c.approved&&t.jsxs("div",{className:"calmlane ob-approved",children:[t.jsx("span",{className:"glyph",children:t.jsx(ce,{size:14,strokeWidth:2.5})}),t.jsxs("span",{children:[t.jsxs("b",{children:[c.approved.by," approved this on ",Ls(c.approved.at),"."]})," ",c.rules.length?"The squad follows these rules. ":"","This page stays up to date after every merged ticket."]})]}),c.old&&t.jsxs("div",{className:"ob-card",children:[t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:"Read by an older squad-kit"}),t.jsx("span",{children:"Read it again to see who uses it, what it can do today, how its parts fit together and three ticket ideas."})]}),t.jsx("button",{className:"btn sm",onClick:()=>n.mutate({path:"/api/v1/overview/read-again",done:"The Architect reads the project again"}),children:"Read it again"})]}),c.empty?!h&&!c.brd&&c.handover!=="reading"&&t.jsxs("div",{className:"ob-row2",children:[t.jsx(Dk,{v:c}),t.jsx(Bk,{v:c,onCreated:u,onWrite:()=>i(!0)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"ob-row2",children:[t.jsx(Dk,{v:c}),t.jsx(hU,{v:c})]}),c.parts.length>0?t.jsx(pU,{v:c}):c.map.length>0?t.jsx(mU,{v:c}):null,t.jsxs("div",{className:"ob-row3",children:[t.jsx(fU,{v:c}),t.jsx(gU,{v:c}),t.jsx(Bk,{v:c,onCreated:u,onWrite:()=>i(!0)})]}),t.jsxs("p",{className:"note ob-foot",children:["Kept in .squad/knowledge, updated after every merged ticket. Decisions and their history are on the ",t.jsx(ge,{to:"/architecture",children:"Architecture page"}),"."]})]})]})}),r&&t.jsx(X3,{onClose:()=>i(!1),onCreated:u})]})}function cU({v:e,onSent:n,onWrite:s}){const r=re(),[i,a]=N.useState(e.idea??""),l=()=>{!i.trim()||r.isPending||r.mutate({path:"/api/v1/overview/idea",body:{text:i},done:"The Architect is reading what you want to build"},{onSuccess:n})};return t.jsxs("section",{className:"ob-talk ob-ask","aria-label":"What do you want to build?",children:[t.jsxs("div",{className:"ob-talk-h",children:[t.jsx(ms,{role:"architect",small:!0}),t.jsx("h2",{children:"What do you want to build?"})]}),t.jsx("p",{className:"note",children:"Say it in your own words, in Arabic or English. The Architect picks the technology itself when your first story is planned."}),t.jsxs("div",{className:"cbox ob-talk-box",children:[t.jsx("textarea",{className:"cta t-mx",rows:3,dir:je(i),value:i,placeholder:"For example: a page where staff write down visitors' names and see today's list","aria-label":"What you want to build",onChange:c=>a(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&!c.nativeEvent.isComposing&&(c.preventDefault(),l())}}),t.jsxs("div",{className:"crow",children:[t.jsx("span",{className:"grow"}),t.jsx("button",{className:"csend","aria-label":"Send",disabled:!i.trim()||r.isPending,onClick:l,children:t.jsx(Zn,{size:17})})]})]}),t.jsxs("div",{className:"ob-talk-f",children:[t.jsx("button",{className:"ob-link",onClick:s,children:"Or write your first ticket yourself."}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:'squad overview --build "…"'})]})]})}function dU({v:e,onChange:n}){const s=re(),r=e.proposed;return t.jsxs("section",{className:"ob-hand","aria-label":"Check the overview",children:[t.jsxs("div",{className:"grow",children:[t.jsx("b",{children:e.empty?"The Architect wrote down what you want to build. Check it, then start.":e.approved&&r?`squad-kit found ${r} new ${r===1?"rule":"rules"} in your code. Check them, then carry on.`:"squad-kit has read your project. Check what it understood, then start."}),t.jsx("span",{children:r?`When you approve, the ${r} ${r===1?"rule":"rules"} below become the rules every agent follows.`:"When you approve, this page becomes the project’s home."})]}),t.jsxs("span",{className:"ob-hand-acts",children:[n?t.jsxs("button",{className:"btn",disabled:s.isPending,onClick:n,children:[t.jsx(Xn,{size:14})," Change what I said"]}):t.jsxs("button",{className:"btn",disabled:s.isPending,onClick:()=>s.mutate({path:"/api/v1/overview/talk",body:{}}),children:[t.jsx(Xn,{size:14})," Something is wrong"]}),t.jsxs("button",{className:"btn pri",disabled:s.isPending,onClick:()=>s.mutate({path:"/api/v1/overview/approve",done:e.empty?"Approved. Start with your first story.":"Approved. The squad follows these rules now. Start with a ticket."}),children:[t.jsx(ce,{size:15})," Looks right, start working"]}),t.jsx(X,{text:"squad overview --approve"})]})]})}function uU({t:e}){const n=re(),[s,r]=$e("overview","talk",""),i=e.messages.some(l=>l.who==="you"),a=(l=s)=>{!l.trim()||e.thinking||n.isPending||n.mutate({path:"/api/v1/overview/talk",body:{text:l}},{onSuccess:()=>r("")})};return t.jsxs("section",{className:"ob-talk","aria-label":"Talk with the Architect",children:[t.jsxs("div",{className:"ob-talk-h",children:[t.jsx(ms,{role:"architect",small:!0}),t.jsx("b",{children:"Tell the Architect what is wrong"}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"iconbtn","aria-label":"Close the talk",onClick:()=>n.mutate({path:"/api/v1/overview/talk/close"}),children:t.jsx(Ue,{size:15})})]}),t.jsxs("div",{className:"ob-thread ccol",children:[e.messages.map((l,c)=>l.who==="you"?t.jsxs("div",{className:"cyou cmsg",children:[t.jsx("div",{className:"cybub",children:t.jsx(Mr,{text:l.text,ticket:""})}),t.jsxs("span",{className:"cmeta",children:["You · ",tn(l.at)]})]},c):l.who==="squad"?t.jsx("div",{className:"cnote-w cmsg",children:t.jsx(R,{className:"cnote-pill",text:l.text})},c):t.jsxs("div",{className:"cag cmsg ag-architect",children:[t.jsx(ms,{role:"architect"}),t.jsxs("div",{className:"cwho",children:[t.jsx("b",{children:"Architect"}),t.jsx("span",{className:"ctime",children:tn(l.at)})]}),t.jsxs("div",{className:"cagb",children:[t.jsx(Mr,{text:l.text,ticket:""}),l.options&&l.options.length>0&&c===e.messages.length-1&&t.jsx("div",{className:"cchoices",children:l.options.map(u=>t.jsx("button",{className:"cch",onClick:()=>a(u),children:t.jsx(R,{text:u})},u))})]})]},c)),e.thinking&&t.jsxs("div",{className:"cag cmsg ag-architect thinking",children:[t.jsx(ms,{role:"architect",live:!0}),t.jsxs("div",{className:"cwho",children:[t.jsx("b",{children:"Architect"}),t.jsx("span",{className:"shim",children:i?"Reading your message":"Looking at what it wrote"})]}),t.jsx("div",{className:"cagb",children:t.jsxs("span",{className:"cdots","aria-label":"The Architect is answering",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]})})]})]}),t.jsxs("div",{className:"cbox ob-talk-box",children:[t.jsx("textarea",{className:"cta t-en",rows:2,dir:je(s),value:s,placeholder:"What did squad-kit get wrong? In Arabic or English","aria-label":"Your message",onChange:l=>r(l.target.value),onKeyDown:l=>{l.key==="Enter"&&!l.shiftKey&&!l.nativeEvent.isComposing&&(l.preventDefault(),a())}}),t.jsxs("div",{className:"crow",children:[t.jsx("span",{className:"grow"}),e.thinking?t.jsxs("button",{className:"cstop",onClick:()=>n.mutate({path:"/api/v1/overview/talk/stop"}),children:[t.jsx(Jn,{size:12,fill:"currentColor"})," Stop"]}):t.jsx("button",{className:"csend","aria-label":"Send",disabled:!s.trim()||n.isPending,onClick:()=>a(),children:t.jsx(Zn,{size:17})})]})]}),t.jsxs("div",{className:"ob-talk-f",children:[t.jsxs("button",{className:"btn pri",disabled:!i||e.thinking||n.isPending,onClick:()=>n.mutate({path:"/api/v1/overview/talk/read-again",done:"The Architect reads the project again with what you said"}),children:[t.jsx(xs,{size:14})," Read it again with this"]}),t.jsx("span",{className:"note",children:"The Architect reads the whole project again with what you said. You check the overview again after."}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:'squad overview --wrong "…"'})]})]})}function Dk({v:e}){const n=[...e.can.map(s=>({text:s,id:""})),...e.since.map(s=>({text:s.title,id:s.id}))];return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:"What it is"}),e.summary?t.jsx(R,{as:"p",className:"ob-lead",text:e.summary}):t.jsx("p",{className:"note",children:"squad-kit has not read the project yet."}),e.empty&&t.jsx("p",{children:"No code yet. The Architect picks the technology when your first story is planned, and saves it as a decision engineers can see."}),(e.users||n.length>0)&&t.jsxs("div",{className:"ob-two",children:[e.users&&t.jsxs("div",{children:[t.jsx("div",{className:"ob-k",children:"Who uses it"}),t.jsx(R,{as:"p",text:e.users})]}),n.length>0&&t.jsxs("div",{children:[t.jsx("div",{className:"ob-k",children:"What it can do today"}),t.jsx("ul",{className:"ob-list",children:n.map((s,r)=>t.jsx(R,{as:"li",text:s.text,children:s.id&&t.jsxs(ge,{to:"/board",search:{ticket:s.id},className:"pill ok sm ob-new",title:"Merged since the first read",children:["new · ",s.id]})},r))})]})]})]})}function hU({v:e}){const n=e.proof,[s,r]=N.useState(null);return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:"Proof squad-kit can work here"}),n?t.jsxs("ul",{className:"ob-proof",children:[n.files!==void 0&&t.jsxs("li",{className:"ok",children:[t.jsx(ce,{size:14})," ",n.files?`Read the project: ${n.files} ${n.files===1?"file":"files"}`:"Read the project"]}),(n.tests??[]).map((i,a)=>t.jsxs("li",{className:i.ok?"ok":"bad",children:[i.ok?t.jsx(ce,{size:14}):t.jsx(Fn,{size:14}),t.jsxs("span",{children:[i.ok?`Ran your tests: ${i.passed!==void 0?`${i.passed} pass`:"they pass"}`:"Your tests did not pass here",!i.ok&&i.output&&t.jsx("button",{className:"btn sm quiet",onClick:()=>r(s===a?null:a),children:s===a?"Hide":"See what failed"})]}),s===a&&i.output&&t.jsx("pre",{className:"ob-out",children:`${i.command}:
740
+ ${i.output}`})]},a)),n.tests?.length===0&&t.jsxs("li",{className:"skip",children:[t.jsx(Fn,{size:14})," No tests yet. Your first ticket can add some."]}),n.app&&t.jsxs("li",{className:n.app.ok?"ok":"bad",children:[n.app.ok?t.jsx(ce,{size:14}):t.jsx(Fn,{size:14}),t.jsx("span",{children:n.app.ok?"Opened the app":"The app did not open here"})]}),n.app?.shot&&t.jsx("li",{className:"ob-shot",children:t.jsx("img",{src:`${Mt(`/api/v1/proof/${n.app.shot}`)}&v=${encodeURIComponent(e.readAt??"")}`,alt:"The app's first page, as squad-kit opened it"})}),n.branch&&t.jsxs("li",{className:"ok",children:[t.jsx(ce,{size:14})," ",n.unsaved?`${n.unsaved} changes here are not saved yet: squad-kit works from what is saved`:"All the code here is saved"]})]}):t.jsx("p",{className:"note",children:e.handover==="reading"?"Comes when the setup has tried your tests and your app.":"Read it again to have squad-kit run your tests and open your app once."})]})}function pU({v:e}){const[n,s]=N.useState(null),{columns:r,below:i}=CC(e.parts,e.links),a=l=>{const c=$C(l,e.parts,e.links);return t.jsxs("button",{className:`ob-node k-${l.kind??"part"} ${n===l.id?"on":""}`,onClick:()=>s(n===l.id?null:l.id),"aria-expanded":n===l.id,children:[t.jsx(R,{as:"b",text:l.name}),l.what&&t.jsx(R,{text:l.what}),l.files.length>0&&n===l.id&&t.jsx("code",{children:l.files.join(`
741
+ `)}),n===l.id&&c&&t.jsx("small",{children:c})]},l.id)};return t.jsxs("section",{className:"ob-c",children:[t.jsxs("div",{className:"ob-c-h",children:[t.jsx("h3",{children:"How it fits together"}),t.jsx("span",{className:"note",children:"Click a box to see its files"})]}),t.jsx("div",{className:"ob-flow",children:r.map((l,c)=>t.jsxs("div",{className:"ob-col-w",children:[c>0&&t.jsxs("span",{className:"ob-arw","aria-hidden":!0,children:[t.jsx(xa,{size:16,className:"h"}),t.jsx(Wv,{size:16,className:"v"})]}),t.jsx("div",{className:"ob-col",children:l.map(a)})]},c))}),i.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"ob-checks","aria-hidden":!0,children:"↑ checks ↑"}),t.jsx("div",{className:"ob-below",children:i.map(a)})]}),e.product&&t.jsxs("p",{className:"ob-product",children:[t.jsx(R,{text:e.product})," ",t.jsx(ge,{to:"/settings",className:"ob-more",children:"An engineer can correct this in Settings"})]})]})}function mU({v:e}){return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:"The project map"}),e.map.map(n=>t.jsxs("div",{className:"maprow",children:[t.jsx(R,{as:"b",text:n.area}),t.jsx(R,{text:n.detail})]},n.area))]})}function fU({v:e}){const n=e.rules,s=n.filter(r=>r.fromScan).length;return t.jsxs("section",{className:"ob-c",children:[t.jsxs("h3",{children:["Rules the squad ",e.proposed?"will follow":"follows"]}),t.jsx("div",{className:"note",children:n.length?s===n.length?`${s}, taken from your code`:`${n.length}: ${s} from your code, ${n.length-s} from tickets`:"None yet. The Architect proposes them with your first ticket."}),t.jsx("ul",{className:"ob-list",children:n.slice(0,10).map(r=>t.jsx(R,{as:"li",title:r.why,text:r.title,children:r.proposed&&e.handover!=="ready"&&t.jsx("span",{className:"pill you sm ob-new",children:"proposed"})},r.id))}),n.length>0&&t.jsx(ge,{to:"/architecture",search:{view:"list"},className:"ob-more",children:"Review them one by one"})]})}function gU({v:e}){return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:"Worth knowing"}),e.worth.length?t.jsx("ul",{className:"ob-list ob-worth",children:e.worth.map((n,s)=>t.jsx(R,{as:"li",text:n},s))}):t.jsx("p",{className:"note",children:"Nothing yet."})]})}function Bk({v:e,onCreated:n,onWrite:s}){const r=re();return t.jsxs("section",{className:"ob-c",children:[t.jsx("h3",{children:e.empty?"Your first stories":e.since.length&&!e.ideas.length?"What next":"Good first tickets"}),t.jsx("ul",{className:"ob-ideas",children:e.ideas.map((i,a)=>t.jsxs("li",{children:[t.jsxs("span",{...ze(i.title),children:[t.jsx(R,{as:"b",text:i.title}),i.why&&t.jsx(R,{as:"small",text:i.why})]}),i.ticket?t.jsx(ge,{to:"/board",search:{ticket:i.ticket},className:"btn sm",children:i.ticket}):t.jsx("button",{className:"btn sm",disabled:r.isPending,title:`squad overview --idea ${a+1}`,onClick:()=>r.mutate({path:`/api/v1/overview/ideas/${a+1}`,done:"On the board. The Analyst reads it first."},{onSuccess:l=>n(l)}),children:"Create"})]},a))}),t.jsxs("p",{className:"note",children:[e.ideas.length?e.empty?"Ideas from what you said. Or ":"Ideas from what the Architect saw. Or ":"",t.jsx("button",{className:"ob-link",onClick:s,children:e.ideas.length?"write your own.":e.since.length?"Write a new ticket.":"Write your first ticket."})]}),e.ideas.some(i=>!i.ticket)&&t.jsx(X,{text:`squad overview --idea ${e.ideas.findIndex(i=>!i.ticket)+1}`}),!e.ideas.length&&t.jsxs("button",{className:"btn sm pri",onClick:s,children:[t.jsx(jt,{size:14})," New ticket"]})]})}function xU(){const e=Bu(),n=re(),{theme:s,toggleTheme:r}=Le(),i=e.data?.setup,a=i?i.steps.some(l=>l.state==="now"||l.state==="todo")&&!i.steps.some(l=>l.state==="stopped"||l.id==="read"&&l.state==="failed"):!1;return t.jsxs("div",{className:"ob-setup",children:[t.jsxs("header",{className:"cpage-h",children:[t.jsxs(ge,{to:"/board",className:"btn",children:[t.jsx(eb,{size:15})," See the board meanwhile"]}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:"squad setup"}),t.jsx("button",{className:"iconbtn",onClick:r,"aria-label":s==="light"?"Switch to dark":"Switch to light",children:s==="light"?t.jsx(wl,{size:16}):t.jsx(Sl,{size:16})})]}),t.jsx("div",{className:"scroll",children:t.jsx("div",{className:"ob-setup-b",children:e.isLoading?null:i?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"ob-head",children:[t.jsx("div",{className:"ob-proj",children:i.project}),t.jsx("h2",{children:i.approved?"Your project is set up":i.ready?i.empty?"Your new project is ready":"squad-kit knows your project now":"Getting to know your project"}),t.jsx("p",{children:i.ready||i.approved?i.empty?"Tell the Architect what you want to build, on the Overview.":"Check what it understood on the Overview, then start your first ticket.":i.kind==="empty"?"A few seconds for a new project. You can leave this page: we will tell you when it is ready.":"About 3 to 5 minutes. You can leave this page: we will tell you when it is ready."})]}),i.self&&t.jsx(Hg,{title:"squad-kit's own code",text:i.self}),t.jsx(EO,{s:i}),i.ready&&!i.approved&&t.jsxs("div",{className:"ob-card ready",children:[t.jsx("span",{className:"ob-ring",children:t.jsx(ce,{size:16,strokeWidth:2.5})}),t.jsxs("span",{className:"grow",children:[t.jsx("b",{children:i.empty?i.idea?"Your first stories are ready":"One question for you":"Your project overview is ready"}),t.jsx("span",{children:i.empty?i.idea?"What the Architect understood from what you said, for you to check.":"What do you want to build?":"What squad-kit understood, for you to check before the first ticket."})]}),t.jsxs(ge,{to:"/overview",className:"btn pri",children:[i.empty&&!i.idea?"Answer it":"Check what squad-kit understood"," ",t.jsx(xa,{size:15})]})]}),t.jsxs("div",{className:"ob-acts",children:[t.jsx(TO,{s:i}),a&&t.jsx("button",{className:"btn",disabled:n.isPending||i.stopping,onClick:()=>n.mutate({path:"/api/v1/setup/stop",done:"Stopped. Start it again any time."}),children:i.stopping?"Stopping…":"Stop"}),a&&t.jsx(X,{text:"squad setup --stop"}),t.jsx("span",{className:"grow"}),t.jsx(AO,{s:i})]}),!i.approved&&t.jsx($O,{s:i})]}):t.jsxs("div",{className:"ob-head",children:[t.jsx("h2",{children:"This project is set up"}),t.jsxs("p",{children:["See what squad-kit understood on the ",t.jsx(ge,{to:"/overview",children:"Overview"}),"."]})]})})})]})}const ps=e=>`/api/v1/requirements/${encodeURIComponent(e)}`;function yU(e,n){const[s,r]=N.useState(Date.now());return N.useEffect(()=>{if(!n)return;const i=setInterval(()=>r(Date.now()),e);return()=>clearInterval(i)},[e,n]),s}function jU({s:e}){return t.jsx("span",{className:`rq-dot ${e.state}`,"aria-hidden":"true",children:e.state==="done"?t.jsx(ce,{size:12,strokeWidth:3.2}):e.state==="now"?t.jsx("i",{}):null})}const kU={done:"Done",now:"Now",todo:"Still to come",failed:"Stopped here"};function Zg({v:e}){const n=Rt();return!e.mine||!e.state.job?.heldFor?null:e.state.job.heldFor==="long"?t.jsxs("button",{className:"btn pri",disabled:n.isPending,title:`squad requirements retry ${e.id}`,onClick:()=>n.mutate({path:`${ps(e.id)}/retry`,done:"The Analyst starts reading."}),children:[t.jsx(kn,{size:13})," Read it"]}):t.jsxs("button",{className:"btn pri",disabled:n.isPending,title:`squad requirements retry ${e.id}`,onClick:()=>n.mutate({path:`${ps(e.id)}/retry`,done:"The Analyst goes on past this month's budget, for the rest of the month."}),children:[t.jsx(kn,{size:13})," Carry on"]})}function vU({v:e}){const n=Rt(),s=e.state.job,r=$i(s),i=yU(5e3,r),a=WC(e),l=s?.status==="stopping",c=e.status==="drafting"?"The Analyst is writing the breakdown":"The Analyst is reading your BRD";return t.jsxs("section",{className:"rq-card rq-reading","aria-label":c,children:[t.jsxs("div",{className:"rq-reading-head",children:[t.jsx("h2",{children:c}),t.jsx("span",{className:"rq-clock",children:DC(s,i)})]}),t.jsx("ol",{className:"rq-steps",children:a.map(u=>t.jsxs("li",{className:`rq-step ${u.state}`,children:[t.jsx(jU,{s:u}),t.jsxs("div",{className:"rq-step-t",children:[t.jsxs("b",{children:[u.title,t.jsxs("span",{className:"sr-only",children:[": ",kU[u.state]]})]}),t.jsx(R,{text:u.sub}),u.bar&&u.state==="now"&&t.jsxs("span",{className:"rq-readbar",role:"progressbar","aria-valuemin":0,"aria-valuemax":u.bar.of,"aria-valuenow":u.bar.done,"aria-label":"How far the Analyst read",children:[t.jsx("i",{style:{flexGrow:Math.max(0,u.bar.done)}}),t.jsx("em",{style:{flexGrow:Math.max(0,u.bar.of-u.bar.done)}})]})]})]},u.key))}),t.jsxs("div",{className:"rq-reading-foot",children:[t.jsx("p",{children:"You can leave this page. Waiting for you tells you when the Analyst needs you."}),t.jsx(Zg,{v:e}),e.mine&&r&&t.jsxs("button",{className:"btn",disabled:l||n.isPending,title:`squad requirements stop ${e.id}`,onClick:()=>n.mutate({path:`${ps(e.id)}/stop`,done:"Stopping the Analyst. Try again carries on from here."}),children:[t.jsx(Jn,{size:13})," ",l?"Stopping…":"Stop"]})]})]})}function bU({v:e}){const n=Rt(),s=_t(),[r,i]=N.useState(!1),a=/^You stopped\b/.test(e.error??e.state.job?.error??""),l=!!e.state.job?.capped,c=a?"You stopped the Analyst":l?"The Analyst reached its limit":"The Analyst stopped";return t.jsx(ug,{calm:a,title:c,what:t.jsx(R,{as:"div",text:t$(e.error??e.state.job?.error??"The read did not get through.",c)}),safe:["Your document is saved.",...e.epics.length?["What the Analyst wrote so far is kept."]:[]],hint:t.jsx(X,{text:`squad requirements ${l?"more":"retry"} ${e.id}`}),ways:e.mine?[l?{label:"Give it more",primary:!0,icon:t.jsx(jt,{size:14}),onClick:()=>n.mutate({path:`${ps(e.id)}/more`,done:"The Analyst carries on with more room."}),disabled:n.isPending,title:`squad requirements more ${e.id}. It carries on where it stopped, with twice the turns and spend for this step.`}:{label:"Try again",primary:!0,icon:t.jsx(gi,{size:14}),onClick:()=>n.mutate({path:`${ps(e.id)}/retry`,done:"The Analyst carries on."}),disabled:n.isPending,title:`squad requirements retry ${e.id}`},...r?[{label:"Yes, delete it",icon:t.jsx(zn,{size:14}),title:`squad requirements delete ${e.id}`,disabled:n.isPending,onClick:()=>n.mutate({path:ps(e.id),method:"DELETE",done:`Deleted ${e.id}.`},{onSuccess:()=>void s({to:"/requirements"})})},{label:"Keep it",onClick:()=>i(!1)}]:[{label:"Delete this breakdown",icon:t.jsx(zn,{size:14}),onClick:()=>i(!0),title:"Deletes the breakdown and its document"}]]:[]})}function wU({v:e,onOpenRef:n}){const s=Rt(),[r,i]=N.useState(()=>Object.fromEntries(e.questions.filter(p=>p.answer).map(p=>[p.id,p.answer]))),a=e.questions,l=p=>{const x=r[p];return!!(x&&(x.choice!=="Other"||x.value?.trim()))},c=a.every(p=>l(p.id)),u=$i(e.state.job)&&e.state.job?.step!=="reply",h=e.decided.length,m=()=>{if(!a.filter(g=>l(g.id)).length)return s.mutate({path:`${ps(e.id)}/skip`,done:"The Analyst decides the open questions and writes each one down."});const x=Object.fromEntries(a.map(g=>[g.id,l(g.id)?r[g.id]:{choice:Fj}]));s.mutate({path:`${ps(e.id)}/answers`,body:{answers:x},done:"Answers sent. The Analyst decides the rest and writes the breakdown."})};return t.jsxs("div",{className:"rq-questions",children:[t.jsxs("div",{className:"rq-qhead",children:[t.jsx("span",{className:"rq-qn","aria-hidden":"true",children:a.length}),t.jsxs("h2",{children:["The Analyst has ",a.length," ",a.length===1?"question":"questions"]})]}),t.jsxs("p",{className:"rq-qlead",children:["The rest of the BRD is clear.",h>0&&` The Analyst decided ${h} small ${h===1?"thing":"things"} itself and wrote each one down. You will see them in the breakdown and can change any of them.`]}),e.state.job?.status==="failed"&&e.state.job.step==="reply"&&t.jsxs("div",{className:"rq-err",role:"alert",children:["The Analyst could not answer your question",e.state.job.error?t.jsxs(t.Fragment,{children:[": ",t.jsx(R,{text:e.state.job.error})]}):"."," ",e.mine&&t.jsx("button",{className:"rq-link",onClick:()=>s.mutate({path:`${ps(e.id)}/${e.state.job?.capped?"more":"retry"}`,done:"The Analyst tries to answer again."}),children:e.state.job.capped?"Give it more":"Try again"})]}),e.state.job?.heldFor==="budget"&&e.state.job.step==="reply"&&t.jsxs("div",{className:"rq-jobline",role:"status",children:[t.jsx(R,{text:e.state.job.now??""}),t.jsx(Zg,{v:e})]}),a.map((p,x)=>t.jsx(NU,{v:e,q:p,n:x+1,answer:r[p.id],onAnswer:g=>i(j=>({...j,[p.id]:g})),onOpenRef:n},p.id)),e.mine&&t.jsxs("div",{className:"rq-qfoot",children:[t.jsx(X,{text:`squad requirements answer ${e.id}`}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn",disabled:s.isPending||u,onClick:m,title:`squad requirements answer ${e.id} --skip`,children:Fj}),t.jsxs("button",{className:"btn you",disabled:!c||s.isPending||u,onClick:()=>s.mutate({path:`${ps(e.id)}/answers`,body:{answers:r},done:"Answers sent. The Analyst writes the breakdown now."}),children:[t.jsx(qs,{size:14})," Send answers"]})]})]})}function NU({v:e,q:n,n:s,answer:r,onAnswer:i,onOpenRef:a}){const l=Rt(),[c,u]=$e(e.id,`ask-${n.id}`,""),[h,m]=N.useState(!!c),p=`q-${e.id}-${n.id}`,x=()=>{c.trim()&&(l.mutate({path:`${ps(e.id)}/questions/${n.id}/ask`,body:{text:c}},{onSuccess:()=>u("")}),m(!1))},g=r?.choice==="Other";return t.jsxs("fieldset",{className:"rq-q",children:[t.jsxs("legend",{className:"sr-only",children:["Question ",s]}),t.jsxs("div",{className:"rq-qtop",children:[t.jsx("span",{className:`rq-tag ${n.kind==="clash"?"clash":"gap"}`,children:n.kind==="clash"?"Two parts clash":"Missing in the BRD"}),t.jsxs("span",{className:"rq-qsrc",children:[(n.refs??[]).map((j,k)=>t.jsxs("span",{children:[k>0&&(k===(n.refs?.length??0)-1?" and ":", "),t.jsx("button",{className:"rq-link",onClick:()=>a(j),title:"Open this place in the document",children:t.jsx(R,{text:HC(j)})})]},k)),n.refs?.length&&n.impact?" · ":"",n.impact&&t.jsx(R,{text:n.impact})]})]}),t.jsx(R,{as:"div",className:"rq-qt",text:n.text}),(n.thread?.length||n.thinking)&&t.jsxs("div",{className:"thread",dir:ze(n.text).dir,children:[n.thread?.map((j,k)=>t.jsxs("div",{className:`msg ${j.who==="you"?"":"squad"}`,children:[t.jsx("small",{children:j.who==="you"?"You":Zs[j.who]}),t.jsx(R,{as:"div",text:j.text})]},k)),n.thinking&&t.jsxs("div",{className:"msg squad",children:[t.jsx("small",{children:"Analyst"}),t.jsxs("span",{className:"typing","aria-label":"Writing a reply",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]})]})]}),n.options.map(j=>t.jsxs("label",{className:`rq-opt ${r?.choice===j?"on":""}`,...ze(j),children:[t.jsx("input",{type:"radio",name:p,checked:r?.choice===j,onChange:()=>i({choice:j}),disabled:!e.mine}),t.jsx(R,{text:j})]},j)),t.jsxs("label",{className:`rq-opt ${g?"on":""}`,children:[t.jsx("input",{type:"radio",name:p,checked:g,onChange:()=>i({choice:"Other",value:r?.value??""}),disabled:!e.mine}),"Something else…"]}),g&&t.jsx("input",{className:"input rq-own",autoFocus:!0,"aria-label":"Your answer",placeholder:"Your answer",dir:je(r?.value??""),value:r?.value??"",onChange:j=>i({choice:"Other",value:j.target.value})}),e.mine&&(h?t.jsxs("div",{className:"askrow",children:[t.jsx("input",{className:"input",autoFocus:!0,dir:je(c),value:c,onChange:j=>u(j.target.value),placeholder:"Ask the Analyst about this question","aria-label":"Your question to the Analyst",onKeyDown:j=>j.key==="Enter"&&x()}),t.jsx("button",{className:"btn",onClick:x,disabled:!c.trim()||l.isPending,children:"Ask"}),t.jsx("button",{className:"btn quiet",onClick:()=>m(!1),children:"Cancel"})]}):t.jsxs("button",{className:"asklink",onClick:()=>m(!0),disabled:n.thinking,title:`squad requirements ask ${e.id} ${n.id} "<text>"`,children:[t.jsx(Xn,{size:14})," Ask about this"]}))]})}const pi=e=>`/api/v1/requirements/${encodeURIComponent(e)}`,au={epic:"Epic",feature:"Feature",story:"Story"};function gl(e){return e.mine&&(e.status==="ready"||e.status==="approved")}function SU(e){const n=e.state.job;return $i(n)&&n?.step==="redo"?n.item??null:null}function X5(e,n){const s=SU(e);if(!s)return!1;if(s===e.id||s===n)return!0;const r=ts(e,s);return!r||r.level==="story"?!1:Ti(r.item).some(i=>i.key===n)||r.level==="epic"&&r.epic.features.some(i=>i.key===n)}function Pm({v:e,mode:n,selected:s,open:r,onToggle:i,onSelect:a,onDecide:l,onAdd:c}){const u=N.useMemo(()=>new Map(e.progress.map(g=>[g.key,g])),[e.progress]),h=ts(e,s),m=h?h.level==="epic"?h.epic.features[0]?.key??h.epic.key:h.feature?.key??h.epic.key:void 0,p=h?.epic.key,x=(g,j)=>t.jsx($U,{s:g,p:u.get(g.key),depth:j,mode:n,selected:s===g.key,onSelect:a,onDecide:l},g.key);return t.jsxs("section",{className:`rq-tree ${n} ${e.epics.some(g=>Ti(g).some(j=>j.tracker))?"refs":""} ${a?"":"still"}`,"aria-label":"Breakdown",children:[e.epics.map(g=>{const j=r.has(g.key);return t.jsxs("div",{className:"rq-group",children:[t.jsx(Wk,{level:"epic",item:g,depth:0,mode:n,isOpen:j,selected:s===g.key,progress:u,onToggle:i,onSelect:a}),j&&t.jsxs(t.Fragment,{children:[g.features.map(k=>{const b=r.has(k.key);return t.jsxs("div",{className:"rq-sub",children:[t.jsx(Wk,{level:"feature",item:k,depth:1,mode:n,isOpen:b,selected:s===k.key,progress:u,onToggle:i,onSelect:a}),b&&k.stories.map(w=>x(w,2)),b&&!k.stories.length&&t.jsx("div",{className:"rq-none d2",children:"No stories yet."})]},k.key)}),g.stories.map(k=>x(k,1)),!g.features.length&&!g.stories.length&&t.jsx("div",{className:"rq-none d1",children:"Nothing under this epic yet."})]})]},g.key)}),!e.epics.length&&t.jsx("p",{className:"note rq-none",children:"No epics yet."}),c&&gl(e)&&t.jsxs("div",{className:"rq-adds",children:[t.jsxs("button",{className:"btn rq-addbtn",onClick:()=>c("epic"),title:`squad requirements add-item ${e.id} --title "…"`,children:[t.jsx(jt,{size:14})," Add an epic"]}),e.epics.length>0&&t.jsxs("button",{className:"btn rq-addbtn",onClick:()=>c("feature",p??e.epics.at(-1)?.key),children:[t.jsx(jt,{size:14})," Add a feature"]}),e.epics.length>0&&t.jsxs("button",{className:"btn rq-addbtn",onClick:()=>c("story",m),children:[t.jsx(jt,{size:14})," Add a story"]})]})]})}function J5({done:e,of:n}){return t.jsx("span",{className:"rq-pb","aria-hidden":"true",children:t.jsx("b",{style:{width:`${n?Math.round(e/n*100):0}%`}})})}function Wk({level:e,item:n,depth:s,mode:r,isOpen:i,selected:a,progress:l,onToggle:c,onSelect:u}){const h=Ti(n),m=Od(h,l),p=e==="feature"?h.filter(g=>l.get(g.key)?.state==="building").map(g=>g.key):[],x=e==="epic"?n.goal:void 0;return t.jsxs("div",{className:`rq-row ${e} d${s} ${a?"sel":""}`,children:[t.jsx("button",{className:"rq-fold","aria-expanded":i,"aria-label":`${i?"Fold":"Open"} ${n.title}`,onClick:()=>c(n.key),children:i?t.jsx(Aa,{size:14,strokeWidth:2.4}):t.jsx(hu,{size:14,strokeWidth:2.4})}),t.jsxs(e6,{onClick:u&&(()=>u(n.key)),current:a,label:`${au[e]} ${n.key} ${n.title}`,children:[t.jsx("span",{className:`rq-lv ${e}`,children:au[e]}),t.jsx(R,{className:"rq-t",title:n.title,text:n.title}),r==="plan"&&x&&t.jsx(R,{className:"rq-meta rq-goal",text:x}),r==="build"&&p.length>0&&t.jsxs("span",{className:"rq-meta rq-live",children:[p.join(", ")," building"]}),t.jsx("span",{className:"grow"}),r==="plan"?t.jsx("span",{className:"rq-meta",children:Db(n)}):t.jsxs(t.Fragment,{children:[t.jsx(J5,{...m}),t.jsxs("span",{className:"rq-meta rq-of",children:[m.done," of ",m.of]})]})]})]})}function e6({onClick:e,current:n,label:s,children:r}){return e?t.jsx("button",{className:"rq-main",onClick:e,"aria-current":n?"true":void 0,"aria-label":s,children:r}):t.jsx("div",{className:"rq-main",children:r})}function CU({p:e}){const n=v1(e?.state);return t.jsxs("span",{className:`rq-st ${n} ${e?.state??"not-started"}`,children:[n==="m"?t.jsx(ce,{size:13,strokeWidth:3,"aria-hidden":"true"}):n==="b"?t.jsx("span",{className:"live","aria-hidden":"true"}):null,t.jsx(R,{className:"rq-stl",text:e?.line??"Not started"})]})}function $U({s:e,p:n,depth:s,mode:r,selected:i,onSelect:a,onDecide:l}){const c=n?.state==="needs-you",u=e.tracker;return t.jsxs("div",{className:`rq-row story d${s} ${i?"sel":""} ${c?"you":""}`,onClick:a&&(()=>a(e.key)),children:[t.jsxs(e6,{onClick:a&&(()=>a(e.key)),current:i,label:`Story ${e.key} ${e.title}${n&&r==="build"?`: ${n.line}`:""}`,children:[r==="plan"&&t.jsx("span",{className:"rq-lv story",children:"Story"}),t.jsx("span",{className:"rq-id",children:e.key}),t.jsx(R,{className:"rq-t",title:e.title,text:e.title}),r==="plan"&&t.jsxs(t.Fragment,{children:[e.dependsOn.slice(0,2).map(h=>t.jsxs("span",{className:"rq-need",children:["needs ",h]},h)),e.dependsOn.length>2&&t.jsxs("span",{className:"rq-need",children:["+",e.dependsOn.length-2]}),!e.criteria.length&&t.jsx("span",{className:"rq-warn",children:'No "done when" yet'}),t.jsx("span",{className:"grow"}),e.ref?.section&&t.jsx("span",{className:"rq-meta rq-from",children:UC(e.ref.section)}),t.jsx("span",{className:"rq-meta rq-size",title:`Size ${e.size}`,children:e.size})]}),r==="build"&&t.jsx("span",{className:"rq-tk",children:n?.ticket??"–"})]}),r==="build"&&(u?.url?t.jsx("a",{className:"rq-ref",href:u.url,target:"_blank",rel:"noreferrer",title:`Open ${u.ref}`,onClick:h=>h.stopPropagation(),children:u.ref}):t.jsx("span",{className:"rq-ref",children:u?.ref??""})),r==="build"&&t.jsxs("span",{className:`rq-stcol ${c?"you":""}`,children:[t.jsx(CU,{p:n}),c&&n?.ticket&&t.jsx("button",{className:"btn you sm",onClick:h=>{h.stopPropagation(),l(n.ticket)},"aria-label":`Decide on ${e.key} ${e.title}`,children:"Decide"})]})]})}function TU(e){const n=ts(e.v,e.k);return n?n.level==="story"?t.jsx(AU,{...e,f:n},n.item.key):t.jsx(PU,{...e,f:n},n.item.key):null}function t6({f:e,onClose:n}){return t.jsxs("div",{className:"rq-ph",children:[t.jsx("span",{className:`rq-lv ${e.level}`,children:au[e.level]}),t.jsx("span",{className:"rq-id",children:e.item.key}),t.jsx("span",{className:"rq-place",children:t.jsx(gb,{path:KC(e)})}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"iconbtn","aria-label":"Close",onClick:n,children:t.jsx(Ue,{size:15})})]})}const EU=e=>({title:e.title,story:e.story,criteria:e.criteria.map(n=>({...n})),size:e.size,needs:[...e.dependsOn]}),Wo=(e,n)=>JSON.stringify(e)===JSON.stringify(n);function n6(e,n,s){const r=ba(gt,e,`panel-${n}`),[i,a]=N.useState(()=>il(r)??s),[l,c]=N.useState({key:n,server:s}),u=!Wo(i,l.server);return N.useEffect(()=>{u&&n===l.key?E1(r,i):al(r)},[r,i,u]),N.useEffect(()=>{if(n!==l.key){a(s),c({key:n,server:s});return}Wo(s,l.server)||(!u||Wo(i,s))&&(a(s),c({key:n,server:s}))},[n,s]),[i,a,u&&n===l.key,()=>a(l.server)]}function AU({v:e,f:n,onClose:s,onSelect:r,onAsk:i,onOpenRef:a,onOpenTicket:l}){const c=n.story,u=Rt(),{toast:h}=Le(),m=e.progress.find(M=>M.key===c.key),p=!!(c.ticket&&m?.ticket),x=X5(e,c.key),g=gl(e)&&!p&&!x,j=N.useMemo(()=>EU(c),[c]),[k,b,w,S]=n6(e.id,c.key,j),[T,E]=N.useState(!1),[z,$]=N.useState(!1),P=e.decided.filter(M=>M.item===c.key),L=ZC(e,c),W=e.status==="approved",F=M=>ts(e,M)?.item.title??"",U=()=>{const M=_j(k.criteria);if(M.length!==k.criteria.length&&b(ae=>({...ae,criteria:_j(ae.criteria)})),M.some(Zp)){$(!0),requestAnimationFrame(()=>[...document.querySelectorAll(".rq-gwt.half textarea")].find(ae=>!ae.value.trim())?.focus());return}$(!1);const Y={};k.title!==c.title&&(Y.title=k.title),k.story!==c.story&&(Y.story=k.story),Wo(M,c.criteria)||(Y.criteria=M),k.size!==c.size&&(Y.size=k.size),Wo(k.needs,c.dependsOn)||(Y.needs=k.needs),Object.keys(Y).length&&u.mutate({path:`${pi(e.id)}/items/${c.key}`,method:"PATCH",body:Y,done:`Saved ${c.key}.`})},I=(M,Y,ae)=>b(H=>({...H,criteria:H.criteria.map((Z,ue)=>ue===M?{...Z,[Y]:ae}:Z)})),D=Kz(e,c.key,k.needs);return t.jsxs("aside",{className:"rq-panel","aria-label":`Story ${c.key}`,"data-dirty":w,children:[t.jsx(t6,{f:n,onClose:s}),t.jsxs("div",{className:"rq-pbody",children:[p&&t.jsxs("div",{className:`rq-started ${v1(m?.state)}`,children:[t.jsxs("span",{children:[t.jsx("b",{className:"mono",children:c.ticket})," ",t.jsx(R,{text:m?.line??""})]}),t.jsx("button",{className:`btn sm ${m?.state==="needs-you"?"you":""}`,onClick:()=>l(c.ticket),children:m?.state==="needs-you"?"Decide":"Open the ticket"})]}),p&&t.jsxs("p",{className:"note",children:["It started as ",c.ticket,", so it changes on its ticket now."]}),x&&t.jsx("p",{className:"rq-busy",children:"The Analyst is redoing this part. It shows here when it is done."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-st",children:"Title"}),g?t.jsx("input",{id:"rq-st",className:"input rq-titlein",dir:je(k.title),value:k.title,onChange:M=>b(Y=>({...Y,title:M.target.value}))}):t.jsx(R,{as:"div",id:"rq-st",className:"rq-ro rq-titlein",text:c.title})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-ss",children:"Story"}),g?t.jsx("textarea",{id:"rq-ss",className:"textarea rq-storyin",dir:je(k.story),value:k.story,placeholder:"As a …, I want …, so that …",onChange:M=>b(Y=>({...Y,story:M.target.value}))}):c.story?t.jsx(R,{as:"div",id:"rq-ss",className:"rq-ro",text:c.story}):t.jsx("div",{id:"rq-ss",className:"rq-ro",children:t.jsx("span",{className:"note",children:"No story text yet."})})]}),t.jsx("div",{className:"rq-lab",children:"Done when"}),t.jsxs("div",{className:"rq-gwts",children:[k.criteria.map((M,Y)=>t.jsxs("div",{className:`rq-gwt ${z&&Zp(M)?"half":""}`,children:[["given","when","then"].map(ae=>t.jsxs("label",{className:"rq-gwtrow",children:[t.jsx("b",{children:ae.charAt(0).toUpperCase()+ae.slice(1)}),g?t.jsx("textarea",{rows:Math.max(1,Math.ceil(M[ae].length/40)),dir:je(M[ae]),value:M[ae],onChange:H=>I(Y,ae,H.target.value.replace(/\n/g," ")),"aria-label":`Check ${Y+1}: ${ae}`}):t.jsx(R,{text:M[ae]})]},ae)),g&&t.jsx("button",{className:"rq-gwt-x","aria-label":`Remove check ${Y+1}`,onClick:()=>b(ae=>({...ae,criteria:ae.criteria.filter((H,Z)=>Z!==Y)})),children:t.jsx(Ue,{size:13})}),z&&Zp(M)&&t.jsx("p",{className:"rq-halfnote",role:"alert",children:"Fill in Given, When and Then, or remove this check. Your other changes are kept."})]},Y)),!k.criteria.length&&t.jsx("p",{className:"rq-warnline",children:'No "done when" yet. A story needs at least one before you approve.'}),g&&t.jsx("button",{className:"rq-link",onClick:()=>b(M=>({...M,criteria:[...M.criteria,{given:"",when:"",then:""}]})),children:"+ Add a check"})]}),t.jsxs("div",{className:"rq-two",children:[t.jsxs("div",{className:"grow",children:[t.jsx("div",{className:"rq-lab",children:"Needs"}),t.jsxs("div",{className:"rq-needs",children:[k.needs.map(M=>t.jsxs("span",{className:"rq-need big",children:[t.jsxs("button",{className:"rq-needname",onClick:()=>r(M),title:`Open ${M} ${F(M)}`,children:[t.jsx("b",{children:M}),t.jsx(R,{text:F(M)})]}),g&&t.jsx("button",{"aria-label":`${c.key} does not need ${M}`,onClick:()=>b(Y=>({...Y,needs:Y.needs.filter(ae=>ae!==M)})),children:t.jsx(Ue,{size:11})})]},M)),!k.needs.length&&!g&&t.jsx("span",{className:"note",children:"Nothing first"}),g&&D.length>0&&t.jsxs("select",{className:"rq-addneed","aria-label":`Add a story ${c.key} needs first`,value:"",onChange:M=>M.target.value&&b(Y=>({...Y,needs:[...Y.needs,M.target.value]})),children:[t.jsx("option",{value:"",children:"+ Add"}),D.map(M=>t.jsx("option",{value:M.key,children:es(M.label)},M.key))]})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:"rq-lab",children:"Size"}),t.jsx("div",{className:"seg rq-sizeseg",role:"group","aria-label":"Size",children:["S","M","L"].map(M=>t.jsx("button",{className:k.size===M?"on":"","aria-pressed":k.size===M,disabled:!g,onClick:()=>b(Y=>({...Y,size:M})),children:M},M))})]})]}),g&&t.jsx(s6,{v:e,f:n}),c.ref&&t.jsxs("div",{className:"rq-fromline",children:["From the BRD:"," ",t.jsx("button",{className:"rq-link",onClick:()=>a(c.ref),children:t.jsx(R,{text:Tl(c.ref)})})]}),P.length>0&&t.jsxs("div",{className:"rq-dbox",children:[t.jsx("div",{className:"rq-lab",children:"Decided for you"}),P.map(M=>t.jsx(Xg,{v:e,d:M,compact:!0,onOpenTicket:l},`${M.ticket??""}${M.id}`))]}),W&&!p&&t.jsxs("div",{className:"rq-startbox",children:[t.jsxs("button",{className:"btn",disabled:L.length>0||u.isPending||!e.mine||!c.criteria.length||w,onClick:()=>u.mutate({path:`${pi(e.id)}/items/${c.key}/start`},{onSuccess:M=>h(`${c.key} started as ${M.ticket?.id??"a ticket"}. It builds by itself.`)}),title:`squad requirements start ${e.id} ${c.key}`,children:[t.jsx(kn,{size:13})," Start this story now"]}),t.jsx("span",{className:"note",children:L.length?`It starts after ${L.join(", ")} ${L.length===1?"merges":"merge"}.`:w?"Save your changes first.":c.ticket?"Its ticket was deleted. This makes a new one that builds by itself.":"It becomes a ticket that builds by itself."})]}),!p&&t.jsx(X,{text:W?`squad requirements start ${e.id} ${c.key}`:`squad requirements edit ${e.id} ${c.key} --title ${Me(k.title)}`})]}),g&&t.jsx("div",{className:"rq-pf",children:T?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"rq-sure",children:["Remove ",c.key,"? It goes out of other stories' needs too."]}),t.jsx("button",{className:"btn danger",onClick:()=>u.mutate({path:`${pi(e.id)}/items/${c.key}`,method:"DELETE",done:`Removed ${c.key}.`},{onSuccess:()=>r(void 0)}),children:"Remove"}),t.jsx("button",{className:"btn",onClick:()=>E(!1),children:"Keep it"})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn",onClick:()=>i(c.key),title:`squad requirements redo ${e.id} ${c.key} "<what to change>"`,children:"Ask the Analyst to redo this"}),w?t.jsx("button",{className:"btn quiet",onClick:()=>{S(),$(!1)},children:"Undo"}):t.jsx("button",{className:"btn quiet",onClick:()=>E(!0),title:`squad requirements remove ${e.id} ${c.key}`,children:"Remove"}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn pri",disabled:!w||u.isPending,onClick:U,children:"Save"})]})})]})}function s6({v:e,f:n}){const s=Rt(),r=VC(e,n),i=YC(n);return r.length<2?null:t.jsxs("div",{className:"field rq-move",children:[t.jsx("label",{htmlFor:`rq-move-${n.item.key}`,children:"Move to"}),t.jsx("select",{id:`rq-move-${n.item.key}`,className:"select",value:i,title:`squad requirements move ${e.id} ${n.item.key} --under <key>`,onChange:a=>a.target.value!==i&&s.mutate({path:`${pi(e.id)}/items/${n.item.key}/move`,body:{under:a.target.value},done:`Moved ${n.item.key}.`}),children:r.map(a=>t.jsx("option",{value:a.key,children:es(a.label)},a.key))})]})}function PU({v:e,f:n,onClose:s,onSelect:r,onAsk:i,onOpenRef:a,onOpenTicket:l,onAdd:c}){const u=Rt(),h=n.level==="epic",m=n.item,p=h?m.goal??"":m.summary??"",x=N.useMemo(()=>({title:m.title,about:p}),[m.title,p]),[g,j,k,b]=n6(e.id,m.key,x),[w,S]=N.useState(!1),T=X5(e,m.key),E=Ti(m),z=new Map(e.progress.map(U=>[U.key,U])),$=E.filter(U=>U.ticket&&z.get(U.key)?.ticket),P=gl(e)&&!T,L=Od(E,z),W=e.decided.filter(U=>U.item===m.key),F=()=>u.mutate({path:`${pi(e.id)}/items/${m.key}`,method:"PATCH",body:{...g.title!==m.title?{title:g.title}:{},...g.about!==p?h?{goal:g.about}:{summary:g.about}:{}},done:`Saved ${m.key}.`});return t.jsxs("aside",{className:"rq-panel","aria-label":`${au[n.level]} ${m.key}`,"data-dirty":k,children:[t.jsx(t6,{f:n,onClose:s}),t.jsxs("div",{className:"rq-pbody",children:[T&&t.jsx("p",{className:"rq-busy",children:"The Analyst is redoing this part. It shows here when it is done."}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-gt",children:"Title"}),P?t.jsx("input",{id:"rq-gt",className:"input rq-titlein",dir:je(g.title),value:g.title,onChange:U=>j(I=>({...I,title:U.target.value}))}):t.jsx(R,{as:"div",id:"rq-gt",className:"rq-ro rq-titlein",text:m.title})]}),t.jsxs("div",{className:"field",children:[t.jsx("label",{htmlFor:"rq-ga",children:h?"What it is for":"What it covers"}),P?t.jsx("textarea",{id:"rq-ga",className:"textarea rq-storyin",dir:je(g.about),value:g.about,onChange:U=>j(I=>({...I,about:U.target.value}))}):p?t.jsx(R,{as:"div",id:"rq-ga",className:"rq-ro",text:p}):t.jsx("div",{id:"rq-ga",className:"rq-ro",children:t.jsx("span",{className:"note",children:"Nothing written yet."})})]}),t.jsxs("div",{className:"rq-stats",children:[t.jsx("span",{children:Db(m)}),e.status==="approved"&&E.length>0&&t.jsxs("span",{children:[t.jsx(J5,{...L})," ",L.done," of ",L.of," merged"]})]}),P&&n.level==="feature"&&t.jsx(s6,{v:e,f:n}),m.ref&&t.jsxs("div",{className:"rq-fromline",children:["From the BRD:"," ",t.jsx("button",{className:"rq-link",onClick:()=>a(m.ref),children:t.jsx(R,{text:Tl(m.ref)})})]}),W.length>0&&t.jsxs("div",{className:"rq-dbox",children:[t.jsx("div",{className:"rq-lab",children:"Decided for you"}),W.map(U=>t.jsx(Xg,{v:e,d:U,compact:!0,onOpenTicket:l},`${U.ticket??""}${U.id}`))]}),gl(e)&&t.jsxs("div",{className:"rq-hereadds",children:[h&&t.jsx("button",{className:"rq-link",onClick:()=>c("feature",m.key),children:"+ Add a feature here"}),t.jsx("button",{className:"rq-link",onClick:()=>c("story",h?m.features[0]?.key??m.key:m.key),children:"+ Add a story here"})]}),t.jsx(X,{text:`squad requirements edit ${e.id} ${m.key} --title ${Me(g.title)}`})]}),P&&t.jsx("div",{className:"rq-pf",children:w?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-sure",children:$.length?`${m.key} has stories that started, so it stays. Move them out first.`:`Remove ${m.key} and the ${E.length} ${E.length===1?"story":"stories"} under it?`}),!$.length&&t.jsxs("button",{className:"btn danger",onClick:()=>u.mutate({path:`${pi(e.id)}/items/${m.key}`,method:"DELETE",done:`Removed ${m.key}.`},{onSuccess:()=>r(void 0)}),children:[t.jsx(zn,{size:13})," Remove"]}),t.jsx("button",{className:"btn",onClick:()=>S(!1),children:$.length?"OK":"Keep it"})]}):t.jsxs(t.Fragment,{children:[t.jsx("button",{className:"btn",onClick:()=>i(m.key),title:`squad requirements redo ${e.id} ${m.key} "<what to change>"`,children:"Ask the Analyst to redo this"}),k?t.jsx("button",{className:"btn quiet",onClick:b,children:"Undo"}):t.jsx("button",{className:"btn quiet",onClick:()=>S(!0),title:`squad requirements remove ${e.id} ${m.key}`,children:"Remove"}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn pri",disabled:!k||!g.title.trim()||u.isPending,onClick:F,children:"Save"})]})})]})}function Xg({v:e,d:n,compact:s,onSelect:r,onOpenTicket:i}){const a=Rt(),{toast:l}=Le(),[c,u]=$e(n.ticket??e.id,`decided-${n.id}`,""),[h,m]=N.useState(!!c),p=!n.ticket&&e.wholeRedo&&!(n.item&&ts(e,n.item))?e.wholeRedo:null,[x,g]=N.useState(!1),j=n.ticket?`/api/v1/tickets/${encodeURIComponent(n.ticket)}/decided/${n.id}`:`${pi(e.id)}/decided/${n.id}`,k=n.ticket?`squad decided ${n.ticket} ${n.id} ${Me(c.trim()||"<text>")}`:`squad requirements decided ${e.id} ${n.id} ${Me(c.trim()||"<text>")}`,b=()=>a.mutate({path:j,body:{text:c.trim(),...p?{whole:!0}:{}},...n.ticket?{}:{done:`Changed. The Analyst redoes ${p?"the breakdown":n.item??"the breakdown"} with it.`}},{onSuccess:T=>{m(!1),g(!1),u(""),n.ticket&&l(Hb(n.ticket,T?.decided?.find(E=>E.id===n.id)?.changed?.ticket))}}),w=n.changed?.ticket,S=w?/^c\d+$/.test(w)?n.ticket:w:void 0;return t.jsxs("div",{className:`rq-dec ${s?"compact":""}`,children:[!s&&t.jsx("div",{className:"rq-dw",children:r&&n.item?t.jsx("button",{className:"rq-link mono",onClick:()=>r(n.item),children:Oj(n)}):Oj(n)}),n.changed?t.jsx(R,{as:"div",className:"rq-dt",text:n.changed.text,children:t.jsxs("span",{className:"rq-was",...ze(n.text),children:[t.jsx("bdi",{dir:"ltr",children:"Was:"})," ",t.jsx(R,{text:n.text}),w&&t.jsxs(t.Fragment,{children:[" · ",S&&i?t.jsx("button",{className:"rq-link rq-now",onClick:()=>i(S),title:`Open ${S}`,children:/^c\d+$/.test(w)?`now change ${w} on ${n.ticket}`:`now ${w}`}):/^c\d+$/.test(w)?`now change ${w} on ${n.ticket}`:`now ${w}`]})]})}):t.jsx(R,{as:"div",className:"rq-dt",text:n.text,children:s&&n.by==="answer"&&t.jsx("span",{className:"rq-was",dir:"ltr",children:"From your answer"})}),h?t.jsxs("div",{className:"rq-dedit",children:[t.jsx("textarea",{className:"textarea",autoFocus:!0,dir:je(c),value:c,onChange:T=>u(T.target.value),"aria-label":"What you want instead",placeholder:"What should it be instead?"}),x&&t.jsx("p",{className:"note",role:"alert",children:p}),t.jsxs("div",{className:"rq-dedit-b",children:[t.jsx("button",{className:"btn sm pri",disabled:!c.trim()||a.isPending,onClick:()=>p&&!x?g(!0):b(),children:x?"Yes, rewrite all of it":"Save change"}),t.jsx("button",{className:"btn sm",onClick:()=>x?g(!1):m(!1),children:x?"Keep it as it is":"Cancel"}),t.jsx(X,{text:k})]})]}):!n.changed&&e.mine&&t.jsx("button",{className:"rq-link",onClick:()=>m(!0),"aria-label":`Change: ${n.text}`,children:"Change"})]})}function RU({v:e,onSelect:n,onOpenTicket:s,onClose:r}){const[i,a]=N.useState(!1),l=e.decided,c=i?l:l.slice(0,5),u=e.status==="approved"&&e.progress.some(h=>h.ticket);return t.jsx("aside",{className:"rq-panel rq-decided","aria-label":"Decided for you",children:t.jsxs("div",{className:"rq-pbody",children:[t.jsxs("div",{className:"rq-dtop",children:[t.jsxs("h2",{className:"rq-dhead",children:["Decided for you ",t.jsx("span",{children:l.length})]}),r&&t.jsx("button",{className:"iconbtn rq-dclose","aria-label":"Close",onClick:r,children:t.jsx(Ue,{size:15})})]}),t.jsxs("p",{className:"rq-dlead",children:["Small choices the squad made where the BRD says nothing. Change one and ",u?"it becomes a small change ticket":"the Analyst redoes the part it is about","."]}),c.map(h=>t.jsx(Xg,{v:e,d:h,onSelect:n,onOpenTicket:s},`${h.ticket??""}${h.id}`)),!l.length&&t.jsx("p",{className:"note",children:"Nothing yet. When the squad decides a small thing itself, it shows here."}),l.length>5&&t.jsx("button",{className:"rq-link rq-showall",onClick:()=>a(!i),children:i?"Show fewer":`Show all ${l.length}`})]})})}const dd={min:.3,max:1.6,step:.1},Uk=e=>Math.round(e*100)/100;function qU({v:e,selected:n,onSelect:s,onDecide:r}){const i=N.useMemo(()=>s$(e),[e.epics,e.progress]),a=N.useMemo(()=>new Map(i.boxes.map(H=>[H.key,H])),[i]),l=N.useRef(null),[c,u]=N.useState(1),[h,m]=N.useState(null),p=N.useMemo(()=>new Map(e.progress.map(H=>[H.key,H])),[e.progress]),x=e.progress.filter(H=>H.state==="needs-you").map(H=>H.key),[g,j]=N.useState(x[0]??null),k=De(),b=k.data?.ready?k.data.tickets:[],w=g?a.get(g):void 0,S=w?r$(i,w):null,T=S?.height??i.height,E=()=>{const H=l.current;H&&u(i$({width:i.width,height:T},{width:H.clientWidth-16,height:H.clientHeight-16}))};N.useLayoutEffect(()=>{const H=l.current;H&&u(a$(i,{width:H.clientWidth-16}))},[]),N.useEffect(()=>{g&&!x.includes(g)&&j(x[0]??null)},[x.join()]);const z=N.useRef(null),$=H=>{if(H.target.closest("button"))return;const Z=l.current;z.current={x:H.clientX,y:H.clientY,left:Z.scrollLeft,top:Z.scrollTop},Z.setPointerCapture(H.pointerId)},P=H=>{const Z=z.current;Z&&(l.current.scrollLeft=Z.left-(H.clientX-Z.x),l.current.scrollTop=Z.top-(H.clientY-Z.y))},L=()=>z.current=null,F=ts(e,h??n??null??void 0),U=F?.story?[...F.story.dependsOn.map(H=>({from:H,to:F.story.key})),...zj(e,F.story.key).map(H=>({from:F.story.key,to:H}))].filter(H=>a.has(H.from)&&a.has(H.to)):[],I=g?p.get(g):void 0,D=I?.ticket?b.find(H=>H.id===I.ticket):void 0,M=g?zj(e,g):[],Y=D?.agentQuestion?.text?Wb(D.agentQuestion.text):D?.waiting?.summary??ts(e,g??void 0)?.item.title??"",ae=H=>{H.level==="story"&&p.get(H.key)?.state==="needs-you"?j(H.key):(j(null),s(H.key))};return t.jsxs("div",{className:"rq-map",children:[t.jsxs("div",{className:"rq-zoom",role:"group","aria-label":"Zoom",children:[t.jsx("button",{className:"btn sm","aria-label":"Zoom out",onClick:()=>u(H=>Math.max(dd.min,Uk(H-dd.step))),children:"−"}),t.jsx("button",{className:"btn sm","aria-label":"Zoom in",onClick:()=>u(H=>Math.min(dd.max,Uk(H+dd.step))),children:"+"}),t.jsx("button",{className:"btn sm",onClick:E,children:"Fit"})]}),t.jsx("div",{className:"rq-mapview",ref:l,onPointerDown:$,onPointerMove:P,onPointerUp:L,onPointerCancel:L,children:t.jsx("div",{className:"rq-mapsize",style:{width:i.width*c,height:T*c},children:t.jsxs("div",{className:"rq-mapcanvas",style:{width:i.width,height:T,transform:`scale(${c})`},children:[t.jsxs("svg",{className:"rq-lines",width:i.width,height:T,"aria-hidden":"true",children:[i.lines.map((H,Z)=>t.jsx("line",{x1:H.x1,y1:H.y1,x2:H.x2,y2:H.y2},Z)),U.map(H=>{const Z=a.get(H.from),ue=a.get(H.to),q=Math.abs(Z.x-ue.x)<2,B=q?Z.x+Z.w:Z.x+(ue.x>Z.x?Z.w:0),ee=q?ue.x+ue.w:ue.x+(ue.x>Z.x?0:ue.w),O=Z.y+Z.h/2,ke=ue.y+ue.h/2,pe=q?34:Math.max(30,Math.abs(ee-B)/2),xe=q?B+pe:B+(ue.x>Z.x?pe:-pe),Te=q?ee+pe:ee+(ue.x>Z.x?-pe:pe);return t.jsx("path",{className:"rq-needline",d:`M${B},${O} C${xe},${O} ${Te},${ke} ${ee},${ke}`,markerEnd:"url(#rq-arrow)"},`${H.from}-${H.to}`)}),t.jsx("defs",{children:t.jsx("marker",{id:"rq-arrow",viewBox:"0 0 8 8",refX:"7",refY:"4",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:t.jsx("path",{d:"M0,0 L8,4 L0,8 z",className:"rq-arrowhead"})})})]}),i.boxes.map(H=>{const Z=p.get(H.key),ue={left:H.x,top:H.y,width:H.w,height:H.h};if(H.level==="story")return t.jsx("button",{className:`rq-chip ${v1(H.state)} ${n===H.key?"sel":""}`,style:ue,title:`${H.key} ${H.title}${Z?`: ${Z.line}`:""}`,"aria-label":`Story ${H.key} ${H.title}${Z?`: ${Z.line}`:""}`,onClick:()=>ae(H),onMouseEnter:()=>m(H.key),onMouseLeave:()=>m(null),onFocus:()=>m(H.key),onBlur:()=>m(null),children:t.jsx(R,{className:"rq-chipt",lead:t.jsx("em",{children:H.key}),text:H.title})},H.key);const q=H.done?.of?Math.round(H.done.done/H.done.of*100):0;return t.jsxs("button",{className:`rq-box ${H.level} ${n===H.key?"sel":""}`,style:ue,onClick:()=>ae(H),title:H.title,"aria-label":`${H.level==="epic"?"Epic":"Feature"} ${H.key} ${H.title}, ${H.done?.done??0} of ${H.done?.of??0} merged`,children:[t.jsx(R,{className:"n",text:H.title}),t.jsxs("span",{className:"p",children:[t.jsx("i",{children:t.jsx("b",{style:{width:`${q}%`}})}),H.level==="epic"?`${H.done?.done??0} of ${H.done?.of??0}`:`${H.done?.done??0}/${H.done?.of??0}`]})]},H.key)}),w&&I&&S&&t.jsxs("div",{className:"rq-pop",style:{left:S.left,top:S.top,width:Ys.popW},role:"dialog","aria-label":`${w.key} needs you`,children:[t.jsx("button",{className:"rq-pop-x","aria-label":"Close",onClick:()=>j(null),children:t.jsx(Ue,{size:13})}),t.jsx("div",{className:"rq-pop-w",children:[w.key,I.ticket,Bb(I.stop)].filter(Boolean).join(" · ")}),t.jsx(R,{as:"div",className:"rq-pop-t",text:Y}),t.jsxs("div",{className:"rq-pop-s",children:[M.length?`${M.join(", ")} ${M.length===1?"waits":"wait"} for it. `:"",e.state.build?.on?"Everything else keeps going.":""]}),I.ticket&&t.jsx("button",{className:"btn sm you",onClick:()=>r(I.ticket),children:"Decide"})]})]})})}),t.jsxs("div",{className:"rq-legend",children:[t.jsxs("span",{className:"k",children:[t.jsx("i",{className:"m"}),"Merged"]}),t.jsxs("span",{className:"k",children:[t.jsx("i",{className:"b"}),"Building"]}),t.jsxs("span",{className:"k",children:[t.jsx("i",{className:"y"}),"Needs you"]}),t.jsxs("span",{className:"k",children:[t.jsx("i",{className:"w"}),"Not started"]}),t.jsx("span",{children:"Click a box to open it. Drag to move around."})]})]})}const mi=e=>`/api/v1/requirements/${encodeURIComponent(e)}`;function r6({text:e,tone:n}){return t.jsxs("span",{className:`rq-chip-s ${n}`,children:[t.jsx("i",{"aria-hidden":"true"}),e]})}function IU(){const e=e4(),n=De(),s=n.data?.ready?n.data.meta.user?.name:void 0,[r,i]=N.useState(!1),a=e.data?.breakdowns??[],l=n.data?.brokenRecords?.filter(c=>c.kind==="breakdown")??[];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"top",children:[t.jsx("h1",{children:"Requirements"}),t.jsx("span",{className:"grow"}),t.jsx(X,{text:"squad requirements list"}),t.jsxs("button",{className:"btn pri",onClick:()=>i(!0),children:[t.jsx(jt,{size:15})," Add a BRD"]})]}),t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"page rq-list",children:[l.length>0&&t.jsx(ml,{list:l,label:"Breakdowns that could not be read"}),e.isLoading?t.jsx("p",{className:"note",children:"Reading your breakdowns…"}):e.isError?t.jsxs("p",{className:"rq-err",role:"alert",children:["squad-kit could not read the breakdowns. ",Na(e.error)]}):a.length?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"note rq-lead",children:"Each BRD you add is one breakdown. Open one to edit it, approve it, send it or build it."}),t.jsx("div",{className:"rq-rows",children:a.map(c=>t.jsx(FU,{r:c,me:s},c.id))})]}):t.jsxs("div",{className:"rq-empty",children:[t.jsx("span",{className:"ring",children:t.jsx(nb,{size:20})}),t.jsxs("div",{children:[t.jsx("h2",{children:"Turn a BRD into stories the squad can build"}),t.jsx("p",{children:"Add your business requirements document: a PDF, a Word file, Markdown or text. The Analyst reads it, asks you only about parts that are missing or that clash, and breaks it into epics, features and stories for you to edit and approve. Nothing is built or sent anywhere until you approve."}),t.jsxs("button",{className:"btn pri",onClick:()=>i(!0),children:[t.jsx(jt,{size:15})," Add a BRD"]})]})]})]})}),r&&t.jsx(Oz,{onClose:()=>i(!1)})]})}function FU({r:e,me:n}){const[s,r]=N.useState(!1),i=IC(e),a=e.counts,l=e.status==="approved"&&(a.merged>0||a.building>0||a.needsYou>0||e.building),c=!n||e.owner.trim().toLowerCase()===n.trim().toLowerCase();return t.jsxs("div",{className:`rq-rowcard ${e.status==="questions"||a.needsYou?"you":""}`,children:[t.jsx(LU,{r:e,chip:i,started:l}),c&&t.jsx(c4,{label:`More actions for ${e.id}`,choices:[{key:"delete",danger:!0,title:`squad requirements delete ${e.id}`,label:t.jsxs(t.Fragment,{children:[t.jsx(zn,{size:15})," Delete breakdown…"]}),onPick:()=>r(!0)}]}),s&&t.jsx(l4,{id:e.id,title:e.title,onClose:()=>r(!1)})]})}function LU({r:e,chip:n,started:s}){const r=e.counts;return t.jsxs(ge,{to:"/requirements/$id",params:{id:e.id},className:"rq-rowlink",children:[t.jsx("span",{className:"rq-rid mono",children:e.id}),t.jsxs("span",{className:"rq-rname",children:[t.jsx(R,{as:"b",text:e.title}),t.jsxs("span",{...ze(e.source.name),children:[t.jsx(Dr,{size:12,"aria-hidden":"true"})," ",t.jsx(R,{text:e.source.name})]})]}),t.jsx("span",{className:"rq-rcount",children:r.epics||r.stories?FC(r):"Not broken down yet"}),t.jsxs("span",{className:"rq-rstate",children:[t.jsx(r6,{...n}),r.needsYou>0&&t.jsxs("span",{className:"rq-rneeds",children:[r.needsYou," ",r.needsYou===1?"needs":"need"," you"]})]}),t.jsx("span",{className:"rq-rprog",children:s&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rq-pb","aria-hidden":"true",children:t.jsx("b",{style:{width:`${r.stories?Math.round(r.merged/r.stories*100):0}%`}})}),t.jsxs("span",{className:"rq-meta",children:[r.merged," of ",r.stories," merged"]})]})})]})}function zU(){const{id:e}=du({from:"/requirements/$id"}),n=_r({from:"/requirements/$id"}),s=_t({from:"/requirements/$id"}),r=qz(e),i=r.data,a=Ia(wu),l=h=>void s({search:m=>({...m,...h}),replace:!0}),c=h=>l({item:h,decided:void 0}),u=h=>l({ticket:h});return r.isLoading?t.jsxs("div",{className:"center",children:["Opening ",e,"…"]}):i?t.jsx(MU,{v:i,search:n,select:c,openTicket:u,setSearch:l,phone:a}):t.jsx("div",{className:"center",children:t.jsxs("div",{children:[t.jsx("h2",{children:/404/.test(String(r.error))?`No breakdown ${e}`:`squad-kit could not open ${e}`}),t.jsx("p",{children:/404/.test(String(r.error))?"It may have been deleted.":Na(r.error)}),t.jsx("p",{style:{marginTop:12},children:t.jsx(ge,{to:"/requirements",className:"btn",children:"All breakdowns"})})]})})}function MU({v:e,search:n,select:s,openTicket:r,setSearch:i,phone:a}){const l=Rt(),c=_t(),{toast:u}=Le(),[h,m]=N.useState(null),p=u4(e),[x,g]=N.useState(()=>Mj(e,n.item)),j=I=>g(D=>{const M=new Set(D);return M.has(I)?M.delete(I):M.add(I),M});N.useEffect(()=>{e.epics.length&&g(I=>I.size?I:Mj(e,n.item))},[e.epics.length]),N.useEffect(()=>{const I=ts(e,n.item);I&&g(D=>D.has(I.epic.key)&&(!I.feature||D.has(I.feature.key))?D:new Set([...D,I.epic.key,...I.feature?[I.feature.key]:[]]))},[n.item,e.epics.length]);const k=e.status==="ready"||e.status==="approved",b=n.view==="map"&&k&&!a,w=e.status==="approved"?"build":"plan",S=ts(e,n.item)?n.item:void 0,T=!!e.state.build?.on,E=Mb(e),z=gl(e)&&!$i(e.state.job),$=!!(h||n.ticket||p.viewer!==void 0);N.useEffect(()=>{if(!S||$)return;const I=D=>{if(D.key!=="Escape"||D.defaultPrevented||document.querySelector(".modal-veil"))return;const M=D.target instanceof HTMLElement?D.target:null;if(M&&/^(INPUT|TEXTAREA|SELECT)$/.test(M.tagName))return M.closest(".rq-panel")?M.blur():void 0;if(document.querySelector('.rq-panel[data-dirty="true"]'))return u("Save or undo your changes first.");s(void 0)};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[S,$]);const P=t.jsx(_U,{v:e,onSend:()=>m({kind:"send"}),onAsk:()=>m({kind:"ask",item:e.id}),phone:a}),L=e.mine?[...e.status==="approved"&&z&&El(e).some(({story:I})=>!I.ticket)?[{key:"ask",title:`squad requirements redo ${e.id} ${e.id} "<what to change>"`,label:t.jsxs(t.Fragment,{children:[t.jsx(Xn,{size:15})," Ask the Analyst…"]}),onPick:()=>m({kind:"ask",item:e.id})}]:[],{key:"delete",danger:!0,title:`squad requirements delete ${e.id}`,label:t.jsxs(t.Fragment,{children:[t.jsx(zn,{size:15})," Delete breakdown…"]}),onPick:()=>m({kind:"delete"})}]:[],W=b?`squad requirements show ${e.id} --map`:e.status==="approved"&&e.mine&&e.counts.merged<e.counts.stories?`squad requirements build ${e.id}${T?" --pause":""}`:`squad requirements show ${e.id}`,F=S?t.jsx(TU,{v:e,k:S,onClose:()=>s(void 0),onSelect:s,onAsk:I=>m({kind:"ask",item:I}),onOpenRef:p.open,onOpenTicket:r,onAdd:(I,D)=>m({kind:"add",level:I,under:D})}):null,U=I=>t.jsx(RU,{v:e,onSelect:s,onOpenTicket:r,onClose:I});return t.jsxs("div",{className:`rq ${a?"phone":""}`,children:[t.jsxs("header",{className:"rq-head",children:[t.jsxs("div",{className:"rq-h1row",children:[t.jsxs("div",{className:"rq-titlecol",children:[t.jsxs("div",{className:"rq-crumbs",children:[t.jsx(ge,{to:"/requirements",children:"Requirements"})," › ",e.id,e.status==="questions"&&t.jsxs(t.Fragment,{children:[" › ",t.jsx(R,{text:e.title})]})]}),t.jsxs("div",{className:"rq-name",children:[t.jsx(OU,{v:e}),t.jsx(r6,{...E})]})]}),t.jsx(X,{text:W,keep:W.slice(W.indexOf(e.id))}),k&&!a&&t.jsxs("div",{className:"seg rq-viewseg",role:"group","aria-label":"View",children:[t.jsx("button",{className:b?"":"on","aria-pressed":!b,onClick:()=>i({view:void 0}),children:"Tree"}),t.jsx("button",{className:b?"on":"","aria-pressed":b,onClick:()=>i({view:"map"}),children:"Map"})]}),!a&&P,t.jsx(c4,{choices:L,label:`More actions for ${e.id}`})]}),k&&t.jsx(WU,{v:e,onDecided:()=>i({item:void 0,decided:!0}),onLeftOut:()=>m({kind:"leftout"}),onDoc:()=>p.open()}),e.status==="approved"&&t.jsx(UU,{v:e}),e.status==="ready"&&e.mine&&(e.problems?.length??0)>0&&t.jsxs("div",{className:"rq-probs",id:"rq-probs",role:"note",children:[t.jsx("b",{children:"Before you approve:"}),t.jsxs("ul",{children:[e.problems.slice(0,4).map(I=>t.jsx(R,{as:"li",text:I},I)),e.problems.length>4&&t.jsxs("li",{children:["and ",e.problems.length-4," more"]})]})]}),!e.mine&&t.jsxs("p",{className:"rq-notmine",children:[e.owner,"'s breakdown: only their squad builds it. You see it read only."]}),t.jsx(HU,{v:e})]}),k?b?t.jsxs("div",{className:"rq-split",children:[t.jsx(qU,{v:e,selected:S,onSelect:I=>s(I),onDecide:r}),F&&t.jsx("div",{className:"rq-aside over",children:F})]}):a?t.jsxs("div",{className:"scroll rq-phonebody",children:[t.jsx(KU,{v:e,onDecide:r}),t.jsx("div",{className:"rq-phonetree",children:t.jsx(Pm,{v:e,mode:w,selected:S,open:x,onToggle:j,onSelect:s,onDecide:r,onAdd:(I,D)=>m({kind:"add",level:I,under:D})})}),t.jsxs("p",{className:"rq-phonenote",children:["The map view is on bigger screens."," ",e.decided.length>0&&t.jsxs("button",{className:"rq-link",onClick:()=>i({item:void 0,decided:!0}),children:[e.decided.length," decided for you"]})]})]}):t.jsxs("div",{className:"rq-split",children:[t.jsx("div",{className:"scroll rq-treecol",children:t.jsx(Pm,{v:e,mode:w,selected:S,open:x,onToggle:j,onSelect:s,onDecide:r,onAdd:(I,D)=>m({kind:"add",level:I,under:D})})}),t.jsx("div",{className:`rq-aside ${F?"":`idle ${n.decided?"wanted":""}`}`,children:F??U(n.decided?()=>i({decided:void 0}):void 0)})]}):t.jsx("div",{className:"scroll",children:t.jsxs("div",{className:"rq-pad",children:[e.status==="failed"?t.jsx(bU,{v:e}):e.status==="questions"?t.jsx(wU,{v:e,onOpenRef:p.open}):t.jsx(vU,{v:e}),(e.status==="drafting"||e.status==="failed")&&e.epics.length>0&&t.jsxs("div",{className:"rq-sofar",children:[t.jsx("div",{className:"rq-lab",children:"What it wrote so far"}),t.jsx(Pm,{v:e,mode:"plan",open:x,onToggle:j,onDecide:r})]})]})}),a&&k&&!b&&(F||n.decided)&&t.jsx("div",{className:"rq-sheet",children:F??U(()=>i({decided:void 0}))}),a&&k&&e.mine&&t.jsx("div",{className:"rq-bottom",children:P}),n.ticket&&t.jsx(q5,{id:n.ticket,onClose:()=>i({ticket:void 0})}),h?.kind==="send"&&t.jsx(_z,{v:e,onClose:()=>m(null)}),h?.kind==="ask"&&t.jsx(Dz,{v:e,item:h.item,text:h.text,onClose:()=>m(null)}),h?.kind==="add"&&t.jsx(Bz,{v:e,level:h.level,under:h.under,onClose:()=>m(null),onAdded:I=>s(I)}),h?.kind==="leftout"&&t.jsx(Wz,{v:e,onClose:()=>m(null),onOpenRef:p.open,onAsk:z?I=>m({kind:"ask",item:e.id,text:I}):void 0}),h?.kind==="delete"&&t.jsx(l4,{id:e.id,title:e.title,sentTo:e.sent?e.tracker?.label:void 0,onClose:()=>m(null),onDeleted:()=>void c({to:"/requirements"})}),p.viewer!==void 0&&t.jsx(d4,{v:e,at:p.viewer??void 0,onClose:p.close}),l.isPending&&t.jsx("span",{className:"sr-only",role:"status",children:"Working…"})]})}function OU({v:e}){const n=Rt(),[s,r]=N.useState(!1),[i,a]=N.useState(e.title);if(!s)return t.jsxs(t.Fragment,{children:[t.jsx(R,{as:"h1",text:e.title}),e.mine&&t.jsx("button",{className:"iconbtn rq-rename","aria-label":"Rename the breakdown",title:`squad requirements rename ${e.id} "<name>"`,onClick:()=>{a(e.title),r(!0)},children:t.jsx(Id,{size:13})})]});const l=()=>n.mutate({path:mi(e.id),method:"PATCH",body:{title:i.trim()},done:"Renamed."},{onSuccess:()=>r(!1)});return t.jsxs("form",{className:"rq-renameform",onSubmit:c=>{c.preventDefault(),i.trim()&&l()},children:[t.jsx("input",{className:"input",autoFocus:!0,"aria-label":"Name of the breakdown",dir:je(i),value:i,onChange:c=>a(c.target.value),onKeyDown:c=>c.key==="Escape"&&r(!1)}),t.jsx("button",{className:"btn sm pri",type:"submit",disabled:!i.trim()||n.isPending,title:`squad requirements rename ${e.id} ${Me(i.trim()||e.title)}`,children:"Save"}),t.jsx("button",{className:"btn sm",type:"button",onClick:()=>r(!1),children:"Cancel"})]})}function _U({v:e,onSend:n,onAsk:s,phone:r}){const i=Rt();if(!e.mine)return null;const a=$i(e.state.job),l=e.tracker&&t.jsxs("button",{className:"btn",onClick:n,disabled:e.state.sync?.status==="running",title:`squad requirements send ${e.id}`,children:[!r&&t.jsx(qs,{size:14})," ",e.sent?"Send changes":`Send to ${e.tracker.label}`]});if(e.status==="ready"){const p=e.problems??[];return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"btn",onClick:s,disabled:a,title:`squad requirements redo ${e.id} ${e.id} "<what to change>"`,children:[!r&&t.jsx(Xn,{size:14})," Ask the Analyst"]}),t.jsxs("button",{className:"btn pri rq-approve",disabled:p.length>0||a||i.isPending,"aria-describedby":p.length?"rq-probs":void 0,title:p.length?p[0]:`squad requirements approve ${e.id}`,onClick:()=>i.mutate({path:`${mi(e.id)}/approve`,done:e.tracker?"Approved. Build continuously, start a story, or send it.":"Approved. Build continuously, or start one story."}),children:[t.jsx(ce,{size:15})," Approve breakdown"]})]})}if(e.status!=="approved")return null;const c=e.counts.stories>0&&e.counts.merged===e.counts.stories,u=!!e.state.build?.on,h=e.state.build?.heldFor==="budget",m=e.state.build?.heldFor==="review";return t.jsxs(t.Fragment,{children:[l,!c&&u&&t.jsxs("button",{className:"btn",disabled:i.isPending,title:`squad requirements build ${e.id} --pause`,onClick:()=>i.mutate({path:`${mi(e.id)}/build`,body:{on:!1},done:"Paused. Running stories finish their step; no new ones start."}),children:[t.jsx(Nl,{size:14})," Pause"]}),!c&&(!u||h||m)&&t.jsxs("button",{className:"btn pri",disabled:i.isPending,title:h?`Go on past this month's budget: squad requirements build ${e.id}`:`squad requirements build ${e.id}`,onClick:()=>i.mutate({path:`${mi(e.id)}/build`,body:{on:!0},done:h?"It goes on past this month's budget, for the rest of the month.":m?"It goes on, with the rewritten stories.":"Building continuously. Stories start in order of what they need."}),children:[t.jsx(kn,{size:14})," Build continuously"]})]})}function Rm(e,n,s=`${n}s`){return`${e} ${e===1?n:s}`}function DU(e,n){return n&&e.trim().toLowerCase()===n.trim().toLowerCase()?"you":e}function BU(e){const n=new Date(e);return n.toDateString()===new Date().toDateString()?"today":`on ${n.toLocaleDateString("en-GB",{day:"numeric",month:"short"})}`}function WU({v:e,onDecided:n,onLeftOut:s,onDoc:r}){const i=De(),a=i.data?.ready?i.data.meta.user?.name:void 0,l=e.source,c=e.estimate,u=k1(c),h=e.counts,m=e.status==="ready";return t.jsxs("div",{className:"rq-info",children:[t.jsxs("span",{children:["From"," ",t.jsx("button",{className:"rq-link",onClick:r,title:"Open the document",children:t.jsx(R,{text:l.name})}),l.kind==="pdf"&&l.pages?`, ${Rm(l.pages,"page")}`:"",l.pictures?`, ${Rm(l.pictures,"picture")}`:"",", added by ",t.jsx(R,{text:DU(l.addedBy,a)})," ",BU(l.addedAt)]}),t.jsxs("span",{children:[t.jsx("b",{children:h.epics})," ",h.epics===1?"epic":"epics",", ",t.jsx("b",{children:h.features})," ",h.features===1?"feature":"features",", ",t.jsx("b",{children:h.stories})," ",h.stories===1?"story":"stories"]}),m&&c.stories>0&&t.jsxs("span",{children:["About ",u.cost&&t.jsxs(t.Fragment,{children:[t.jsx("b",{children:u.cost})," and "]}),t.jsx("b",{children:u.time})," to build, ",c.parallel," at a time ",t.jsxs("span",{className:"rq-dim",children:["(",Ob(c),")"]})]}),e.decided.length>0&&t.jsxs("button",{className:"rq-link",onClick:n,children:[e.decided.length," decided for you"]}),e.leftOut.length>0&&t.jsxs("button",{className:"rq-link",onClick:s,children:[Rm(e.leftOut.length,"part")," left out"]}),e.sent&&e.tracker&&t.jsxs("span",{children:["Sent to ",e.tracker.label]})]})}function UU({v:e}){const n=Rt(),s=e.counts,r=QC(s),i=!!e.state.build?.on,a=e.state.build?.held,l=e.state.sync,c=s.merged+s.building+s.needsYou>0||e.progress.some(g=>g.ticket),u=Math.max(0,s.stories-s.merged-s.building-s.needsYou),h=e$(e),m=nf(l,r4(e.id)),p=Ub(m),x="It stops only for a missing part, a clash or a failed check, and merges each story when its checks and review pass. You send releases out from Releases.";return t.jsxs("div",{className:"rq-build",children:[c||i?t.jsxs("div",{className:"rq-progress",children:[t.jsxs("span",{className:"rq-segbar",role:"img","aria-label":`${s.merged} of ${s.stories} stories merged, ${s.building} building, ${s.needsYou} need you`,children:[r.merged>0&&t.jsx("i",{className:"m",style:{flexGrow:r.merged}}),r.building>0&&t.jsx("i",{className:"b",style:{flexGrow:r.building}}),r.needsYou>0&&t.jsx("i",{className:"y",style:{flexGrow:r.needsYou}}),r.rest>0&&t.jsx("i",{className:"w",style:{flexGrow:r.rest}})]}),t.jsxs("span",{className:"rq-pnum",children:[t.jsxs("b",{children:[s.merged," of ",s.stories]})," ","merged"]}),t.jsx("span",{className:"rq-meta",children:[s.building?`${s.building} building`:"",s.needsYou?`${s.needsYou} ${s.needsYou===1?"needs":"need"} you`:"",u?`${u} to go`:""].filter(Boolean).join(", ")}),s.merged<s.stories&&t.jsx("span",{className:"rq-meta",children:OC(e.estimate)})]}):e.mine&&t.jsxs("div",{className:"rq-rule",children:["Build continuously: ",MC(e.estimate),". ",x]}),(c||i)&&i&&s.merged<s.stories&&t.jsxs("div",{className:"rq-rule",children:[e.estimate.parallel," at a time. ",x]}),h&&t.jsxs("div",{className:"rq-built",role:"status",children:[t.jsx(ce,{size:14,strokeWidth:2.6,"aria-hidden":"true"}),t.jsxs("span",{children:[t.jsx(R,{text:h.text}),h.release&&t.jsxs(t.Fragment,{children:[" ","Send it out from ",t.jsx(ge,{to:"/releases",children:"Releases"}),"."]})]})]}),a&&(i||e.state.build?.heldFor==="budget")&&t.jsxs("div",{className:"rq-held",role:"status",children:[t.jsx(Nl,{size:13,"aria-hidden":"true"})," Waiting: ",t.jsx(R,{text:a})]}),l&&(l.status==="running"||l.status==="pending")&&t.jsxs("div",{className:"rq-syncline",role:"status",children:["Sending to ",e.tracker?.label??"the tracker",p?`: ${p}`:"…",t.jsx("span",{className:"rq-pbar",children:t.jsx("i",{style:{width:`${m.pct||5}%`}})})]}),l?.status==="failed"&&t.jsxs("div",{className:"rq-syncline fail",role:"alert",children:["The send to ",e.tracker?.label??"the tracker"," stopped",l.error?`: ${l.error}`:".",e.mine&&t.jsx("button",{className:"btn sm",disabled:n.isPending,onClick:()=>n.mutate({path:`${mi(e.id)}/send`,done:"Sending again. What was sent stays; nothing is made twice."}),children:"Send again"})]})]})}function HU({v:e}){const n=Rt(),s=e.state.job;return!$i(s)||e.status!=="ready"&&e.status!=="approved"?s?.status==="failed"&&s.step==="redo"&&(e.status==="ready"||e.status==="approved")?t.jsxs("div",{className:"rq-jobline fail",role:"status",children:["The redo of ",s.item===e.id?"the breakdown":s.item," stopped",s.error?t.jsxs(t.Fragment,{children:[": ",t.jsx(R,{text:s.error})]}):".",e.mine&&t.jsx("button",{className:"btn sm",onClick:()=>n.mutate({path:`${mi(e.id)}/${s.capped?"more":"retry"}`,done:"The Analyst tries the redo again."}),children:s.capped?"Give it more":"Try again"})]}):null:t.jsxs("div",{className:"rq-jobline",role:"status",children:[t.jsx("span",{className:"live","aria-hidden":"true"}),t.jsx(R,{text:s.status==="stopping"?"Stopping the Analyst…":`${s.now??"The Analyst is working"}${s.ask?`: "${s.ask}"`:""}`}),t.jsx(Zg,{v:e}),e.mine&&s.status!=="stopping"&&t.jsx("button",{className:"btn sm",onClick:()=>n.mutate({path:`${mi(e.id)}/stop`,done:"Stopping the Analyst."}),title:`squad requirements stop ${e.id}`,children:"Stop"})]})}function KU({v:e,onDecide:n}){const s=De(),r=s.data?.ready?s.data.tickets:[],i=e.progress.filter(l=>l.state==="needs-you"),a=N.useMemo(()=>i.map(l=>{const c=ts(e,l.key)?.story,u=l.ticket?r.find(m=>m.id===l.ticket):void 0,h=u?.agentQuestion?.text?Wb(u.agentQuestion.text):u?.waiting?.summary;return t.jsxs("div",{className:"rq-youcard",children:[t.jsx("div",{className:"rq-pop-w",children:[l.key,l.ticket,Bb(l.stop)].filter(Boolean).join(" · ")}),t.jsx(R,{as:"div",className:"rq-youcard-t",text:`${c?.title??""}${h?`: ${h.charAt(0).toLowerCase()}${h.slice(1)}`:""}`}),l.ticket&&t.jsx("button",{className:"btn you",onClick:()=>n(l.ticket),children:"Decide"})]},l.key)}),[i.map(l=>l.key+l.ticket).join(),r]);return t.jsx(t.Fragment,{children:a})}function VU(){const[e,n]=N.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"linkbtn lead-can",onClick:()=>n(!0),children:[t.jsx(ja,{size:13,"aria-hidden":"true"})," What it can do"]}),e&&t.jsx(QU,{onClose:()=>n(!1)})]})}function YU({b:e}){const n=(s,r)=>r.length?t.jsx(R,{as:"li",lead:t.jsx("b",{children:s}),text:r.join(", ")}):null;return t.jsxs("section",{className:"lead-brief",children:[t.jsx("div",{className:"lbl",children:"This morning"}),t.jsxs("div",{className:"lr-brief",children:[t.jsx(R,{as:"p",text:e.headline}),t.jsxs("ul",{children:[n("Merged",e.merged),n("Released",e.released),n("Working",e.working),n("Stopped",e.stopped)]}),e.costUsd!==void 0&&t.jsxs("span",{className:"note",children:["The AI used ",ha(e.costUsd)," since then."]})]})]})}const GU=["var(--accent)","var(--you)","var(--bug)"];function QU({onClose:e}){const n=NM(),s=wM(),r=re(),i=s.data,a=(h,m,p)=>r.mutate({path:"/api/v1/lead/rules",method:"PUT",body:{always:h,brief:m},done:p}),l=(h,m)=>{if(!i)return;const p=i.always.includes(h);a(p?i.always.filter(x=>x!==h):[...i.always,h],i.brief,p?`It asks you each time now: ${m.toLowerCase()}`:`Always allowed: ${m.toLowerCase()}`)},c=n.data?.levels??[],u=i?`squad lead rules --always ${i.always.length?i.always.join(","):"none"} --brief ${i.brief?"on":"off"}`:"squad lead rules";return t.jsx(Ye,{title:"What the Squad lead can do",wide:!0,onClose:e,footer:t.jsxs(t.Fragment,{children:[t.jsx(X,{text:u}),t.jsx("span",{className:"grow"}),t.jsx("button",{className:"btn pri",onClick:e,children:"Done"})]}),children:t.jsxs("div",{className:"lr-can",children:[c.map((h,m)=>t.jsxs("div",{className:"lr-level",children:[t.jsxs("b",{children:[t.jsx("span",{className:"d",style:{background:GU[m]}}),h.name]}),t.jsx("ul",{children:h.items.map(p=>t.jsx("li",{children:p},p))}),h.level===2&&i&&t.jsxs("div",{className:"lr-always",children:[t.jsx("p",{className:"note",children:n.data?.always.words}),i.allowable.map(p=>{const x=i.always.includes(p.id);return t.jsxs("button",{className:"switch",onClick:()=>l(p.id,p.name),"aria-pressed":x,disabled:r.isPending,children:[t.jsxs("span",{children:["Always allow: ",p.name.toLowerCase()]}),t.jsx("span",{className:`tog ${x?"on":""}`})]},p.id)})]}),h.level===3&&t.jsx("p",{className:"note",children:"squad-kit refuses these in its own words, whoever asks. They cannot be turned on."})]},h.level)),i&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:"switch",onClick:()=>a(i.always,!i.brief,i.brief?"The morning brief is off":"The morning brief is on"),"aria-pressed":i.brief,disabled:r.isPending,children:[t.jsx("span",{children:"Morning brief: a short summary since yesterday evening, with no AI"}),t.jsx("span",{className:`tog ${i.brief?"on":""}`})]}),t.jsxs("p",{className:"note lr-limits",children:["One question may use up to ",ha(i.limits.questionUsd)," or ",i.limits.questionTurns," turns and ",i.limits.minutes," minutes. All the answers of a day may use"," ",ha(i.limits.dayUsd),", at API prices. Today: ",ha(i.today.costUsd),"."]})]})]})})}function ZU(){const e=_r({from:"/lead"}),n=_t(),s=_u(),r=De(),i=XU(),a=e.c??null,l=E4(a),{send:c,busy:u}=P4(),[h,m]=N.useState(""),[p,x]=N.useState(!1),g=a?l.data:void 0,j=C1(a??"new",xw(g));bg("lead",()=>vg(document.querySelector(".lead-composer")));const b=(r.data?.ready?r.data.meta:void 0)?.project??"the project",w=T=>{x(!1),n({to:"/lead",search:T?{c:T}:{}})},S=(T=h,E=!1)=>c({text:T.trim(),conversation:g?.id??null,context:g?null:{from:"board",page:"Squad lead"},fresh:E},z=>{m(""),j.toBottom(),z.id!==a&&w(z.id)});return t.jsx("div",{className:"lead-page",children:t.jsxs("div",{className:"lead-thread",children:[t.jsxs("header",{className:"lead-h",children:[t.jsx("img",{className:"lead-logo",src:"/logo.svg",alt:""}),t.jsxs("div",{className:"lead-title",children:[t.jsx("h1",{children:"Squad lead"}),t.jsx(JU,{project:b,now:s.data?.squadNow??[]})]}),t.jsx("span",{className:"grow"}),t.jsxs("button",{className:"btn sm",onClick:()=>w(null),disabled:!a,"aria-label":"New conversation",children:[t.jsx(jt,{size:14})," ",t.jsx("span",{className:"wide",children:"New conversation"})]}),t.jsxs("span",{className:"lead-hist",children:[t.jsxs("button",{className:"btn sm",onClick:()=>x(!p),"aria-expanded":p,"aria-haspopup":"true","aria-label":"History",children:[t.jsx(sS,{size:14})," ",t.jsx("span",{className:"wide",children:"History"})]}),p&&t.jsx(tH,{items:s.data?.conversations??[],current:a,onPick:w,onClose:()=>x(!1)})]})]}),t.jsxs("div",{className:"scroll lead-feed",ref:a?j.boxRef:void 0,children:[t.jsx("div",{className:"lead-col",ref:a?j.contentRef:void 0,children:a&&l.isError&&!g?t.jsx(ys,{what:"this conversation",error:l.error,onRetry:()=>void l.refetch()}):g?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"lead-day",children:[Ls(g.startedAt)," · ",t.jsx(R,{text:g.title})]}),g.turns.map((T,E)=>t.jsx(M4,{c:g,turn:T,last:E===g.turns.length-1,onAgain:(z,$)=>S(z,$)},T.n))]}):a?t.jsx("p",{className:"note",children:"Loading…"}):t.jsx(eH,{view:s.data,apps:i,onPick:T=>m(T),onOpen:w})}),a&&t.jsx($1,{s:j})]}),t.jsxs("div",{className:"lead-composer",children:[t.jsx(R4,{id:"lead-page-ask",value:h,onChange:m,onSend:()=>S(),busy:u||!!g?.thinking,placeholder:g?"Ask a follow-up…":`Ask about ${b}, or ask for something…`,chip:g&&g.context.from!=="board"?t.jsx(q4,{ctx:g.context}):void 0,autoFocus:!a}),t.jsxs("div",{className:"lead-foot",children:[t.jsx(TM,{}),t.jsx(VU,{})]})]})]})})}function XU(){return(gu().data?.apps??[]).map(e=>e.name)}function JU({project:e,now:n}){const{line:s,more:r}=rT(n);return t.jsxs("div",{className:"lead-sub",title:r||void 0,children:[t.jsx("span",{className:`pulse ${n.length?"":"idle"}`,"aria-hidden":"true"}),t.jsx(R,{text:e}),t.jsxs("span",{children:["· ",s]})]})}function eH({view:e,apps:n,onPick:s,onOpen:r}){const i=bw({apps:n,needsYou:e?.needsYou??[],squadNow:e?.squadNow??[]}),a=(e?.conversations??[]).slice(0,5),l=e?.whatsNew??[];return t.jsxs("div",{className:"lead-empty",children:[t.jsx("h2",{children:"Ask about the app, the stories or the code"}),t.jsx("p",{children:"Or say what is wrong. It reads what the squad knows, looks at the app in its own copy, and answers in plain words. Changes come as stories you create."}),t.jsx("div",{className:"lead-examples",children:i.map(c=>t.jsx("button",{className:"lead-ex",onClick:()=>s(c),children:c},c))}),e?.brief&&t.jsx(YU,{b:e.brief}),l.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"What's new"}),t.jsx("ul",{className:"lead-news",children:l.slice(0,5).map(c=>t.jsx("li",{children:t.jsx(ge,{to:"/board",search:{ticket:c.story},children:t.jsx(R,{text:c.words})})},c.id))})]}),a.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"lbl",children:"Recent conversations"}),t.jsx(i6,{items:a,current:null,onPick:r})]})]})}function i6({items:e,current:n,onPick:s}){return t.jsx("ul",{className:"lead-list",children:e.map(r=>t.jsx("li",{children:t.jsxs("button",{className:r.id===n?"on":"",onClick:()=>s(r.id),children:[t.jsx(R,{as:"b",text:r.title}),t.jsxs("small",{children:[r.thinking?t.jsx("span",{className:"live","aria-label":"Answering now"}):null,st(r.updatedAt),r.turns>1?` · ${r.turns} questions`:"",r.costUsd?` · ${ha(r.costUsd)}`:"",r.story?` · made ${r.story}`:""]})]})},r.id))})}function tH({items:e,current:n,onPick:s,onClose:r}){return N.useEffect(()=>{const i=a=>a.key==="Escape"&&r();return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[r]),t.jsx("div",{className:"lead-histmenu",role:"dialog","aria-label":"Past conversations",children:e.length?t.jsx(i6,{items:e,current:n,onPick:s}):t.jsx("p",{className:"note",children:"No conversations yet."})})}const ki={en:{head:"Connections",sub:"The outside tools this project works with. Sign in once; squad-kit keeps no password.",state:{connected:"Connected","not-connected":"Not connected",missing:"Not connected",unknown:"No answer",soon:"Coming next"},unknownLine:e=>`${e}'s own tool did not answer just now. Press Check again in a moment.`,signedInAs:"Signed in as",disconnect:"Disconnect",guide:"Can't use the button? Do it step by step",check:"Check again",toolPage:"Get it on the Tools page",stepFoot:e=>`squad-kit asks ${e}'s tool for the sign-in each time it calls ${e}, and stores nothing.`,soonLine:"Coming in a next version.",tokenLine:e=>`Today: a token you paste.${e?` Next: ${e}.`:""}`,nextTag:"Next version",tokenInSettings:e=>`${e} connects with a token you paste in Settings, where you choose this project's tracker.`,openSettings:"Open Settings",connectedNow:e=>`${e} is connected`,forWhat:e=>e.self&&e.into&&e.into.toLowerCase()!==e.repo.toLowerCase()?`For this fork: pull requests into ${e.into}, and the owner's comments back here.`:e.self?`Pull requests into ${e.into??e.repo}, and the owner's comments back here.`:`For ${e.repo}: squad-kit opens its pull requests and merges them when you say Looks right.`,code:{head:e=>`Sign in with ${e}`,sub:e=>`Open ${e}, type this code there, then press Authorize.`,copy:"Copy code",copied:"Code copied",open:e=>`Open ${e}`,wait:e=>`Waiting for you to approve on ${e}…`,cancel:"Cancel",starting:e=>`Asking ${e}'s tool for a code…`,foot:e=>`squad-kit gets permission to push your branches and open pull requests. You can take it back on ${e} at any time.`,again:"Try again",close:"Close",lost:"The sign-in stopped before it finished. Try again."},off:{head:e=>`Disconnect ${e}?`,body:(e,n)=>`This signs ${e}'s own tool out on this computer, as ${n}, for every app that uses it, not only squad-kit. You can sign in again at any time.`,yes:"Disconnect",no:"Keep it"}},ar:{head:"الاتصالات",sub:"الأدوات الخارجية اللي يشتغل معها المشروع. سجّل مرة وحدة، وsquad-kit ما يحفظ أي كلمة سر.",state:{connected:"متصل","not-connected":"غير متصل",missing:"غير متصل",unknown:"ما رد",soon:"قريباً"},unknownLine:e=>`أداة ${e} ما ردت الحين. اضغط افحص مرة ثانية بعد شوي.`,signedInAs:"مسجّل باسم",disconnect:"افصل",guide:"الزر ما اشتغل؟ اتبع الخطوات",check:"افحص مرة ثانية",toolPage:"خذها من صفحة الأدوات",stepFoot:e=>`squad-kit يطلب التسجيل من أداة ${e} كل مرة يكلّم ${e}، وما يحفظ شيء.`,soonLine:"في نسخة قادمة.",tokenLine:e=>`اليوم: رمز تلصقه.${e?` قريباً: ${e}.`:""}`,nextTag:"النسخة القادمة",tokenInSettings:e=>`${e} يتصل برمز تلصقه في الإعدادات، مكان ما تختار متتبّع المشروع.`,openSettings:"افتح الإعدادات",connectedNow:e=>`${e} متصل`,forWhat:e=>e.self&&e.into&&e.into.toLowerCase()!==e.repo.toLowerCase()?`لهذه النسخة: طلبات دمج إلى ${e.into}، وتعليقات المالك ترجع هنا.`:e.self?`طلبات دمج إلى ${e.into??e.repo}، وتعليقات المالك ترجع هنا.`:`لـ ${e.repo}: squad-kit يفتح طلبات الدمج ويدمجها لما تقول تمام.`,code:{head:e=>`سجّل الدخول بـ ${e}`,sub:e=>`افتح ${e}، اكتب هذا الرمز هناك واضغط Authorize.`,copy:"انسخ الرمز",copied:"انتسخ الرمز",open:e=>`افتح ${e}`,wait:e=>`بانتظار موافقتك على ${e}…`,cancel:"إلغاء",starting:e=>`نطلب رمز من أداة ${e}…`,foot:e=>`squad-kit ياخذ إذن يرفع فروعك ويفتح طلبات الدمج. تقدر تسحب الإذن من ${e} في أي وقت.`,again:"جرّب مرة ثانية",close:"إغلاق",lost:"التسجيل وقف قبل ما يخلص. جرّب مرة ثانية."},off:{head:e=>`تفصل ${e}؟`,body:(e,n)=>`هذا يسجّل خروج أداة ${e} الرسمية على هذا الجهاز، باسم ${n}، لكل تطبيق يستخدمها، مو بس squad-kit. تقدر تسجّل الدخول مرة ثانية في أي وقت.`,yes:"افصل",no:"خلّه"}}},Hk=["ink","blue","sky"],nH=e=>e.includes(" ")?e.slice(0,2):e.replace(/[^A-Z]/g,"").slice(0,2)||e.slice(0,2);function sH({label:e,at:n}){return t.jsx("span",{className:`gh-tile ${Hk[n%Hk.length]}`,"aria-hidden":"true",dir:"ltr",children:nH(e)})}function Kk({row:e,lang:n,open:s,onCheck:r,checking:i}){const a=ki[n];return t.jsxs("details",{className:"gh-guide",open:s,children:[t.jsxs("summary",{children:[t.jsx(Aa,{size:14,"aria-hidden":"true"}),a.guide]}),t.jsx("ol",{className:"gh-steps",children:e.steps.map((l,c)=>t.jsxs("li",{children:[t.jsx("span",{className:"gh-n","aria-hidden":"true",children:c+1}),t.jsxs("div",{children:[t.jsx("span",{children:l.text[n]}),l.command&&t.jsx(X,{text:l.command,always:!0}),l.done?t.jsxs("span",{className:"gh-done",children:[t.jsx(ce,{size:13,strokeWidth:2.6,"aria-hidden":"true"}),l.done[n]]}):l.page&&t.jsx(ge,{to:l.page.split("#")[0],hash:l.page.split("#")[1],className:"gh-link",children:a.toolPage})]})]},c))}),e.how==="sign-in"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"gh-row",children:[t.jsxs("button",{className:"btn sm",disabled:i,onClick:r,children:[t.jsx(xs,{size:13})," ",a.check]}),t.jsx(X,{text:"squad connect --status"})]}),t.jsx("p",{className:"gh-small",children:a.stepFoot(e.label)})]})]})}function Vk({label:e,lang:n}){const s=ki[n];return t.jsxs("div",{className:"gh-row",children:[t.jsx("span",{className:"gh-muted",children:s.tokenInSettings(e)}),t.jsx(ge,{to:"/settings",hash:"tracker",className:"btn sm",children:s.openSettings})]})}function rH({row:e,lang:n,onClose:s}){const r=ki[n].off,i=re(),a=e.actions.find(l=>l.id==="disconnect");return N.useEffect(()=>{const l=c=>c.key==="Escape"&&s();return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[s]),t.jsx("div",{className:"modal-veil",onMouseDown:l=>l.target===l.currentTarget&&s(),children:t.jsxs("div",{className:"modal gh-code",role:"alertdialog","aria-modal":"true","aria-label":r.head(e.label),dir:n==="ar"?"rtl":"ltr",lang:n,children:[t.jsx("h2",{children:r.head(e.label)}),t.jsx("p",{className:"gh-muted",children:r.body(e.label,e.account??"")}),t.jsxs("div",{className:"gh-row",children:[t.jsx("button",{className:"btn sm danger",disabled:i.isPending,onClick:()=>i.mutate({path:`/api/v1/connections/${e.name}/disconnect`,done:l=>l.line},{onSuccess:s}),children:r.yes}),t.jsx("button",{className:"btn sm",autoFocus:!0,onClick:s,children:r.no}),t.jsx(X,{text:a.command})]})]})})}function iH({row:e,at:n,lang:s,onSignIn:r,onCheck:i,checking:a}){const l=ki[s],[c,u]=N.useState(!1),h=e.state==="connected",m=e.actions.find(x=>x.id==="sign-in"),p=h?"ok":e.state==="soon"?"soon":"no";return t.jsxs("section",{className:`gh-conn ${e.for&&!h&&e.how==="sign-in"?"focus":""}`,"aria-label":e.label,children:[t.jsxs("div",{className:"gh-hd",children:[t.jsx(sH,{label:e.label,at:n}),t.jsxs("div",{children:[t.jsx("b",{children:e.label}),t.jsx("small",{children:e.what[s]})]}),t.jsx("span",{className:`gh-state ${p}`,children:l.state[e.state]})]}),h?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"gh-who",children:[t.jsx("span",{className:"gh-av","aria-hidden":"true",dir:"ltr",children:(e.account??"?").slice(0,2).toUpperCase()}),t.jsxs("div",{children:[t.jsx("small",{children:l.signedInAs}),t.jsx("b",{dir:"ltr",children:e.account})]}),e.actions.some(x=>x.id==="disconnect")&&t.jsx("button",{className:"btn sm",onClick:()=>u(!0),children:l.disconnect})]}),t.jsx("ul",{className:"gh-can",children:e.can.map(x=>t.jsxs("li",{children:[t.jsx(ce,{size:13,strokeWidth:2.6,"aria-hidden":"true"}),x[s]]},x.en))}),e.how==="token"&&t.jsx(Vk,{label:e.label,lang:s})]}):e.how==="soon"?t.jsxs(t.Fragment,{children:[t.jsx("p",{children:l.soonLine}),t.jsx("div",{className:"gh-row",children:t.jsx("button",{className:"btn pri",disabled:!0,title:l.soonLine,children:e.next?.[s]})})]}):e.how==="token"?t.jsxs(t.Fragment,{children:[t.jsx("p",{children:l.tokenLine(e.next?.[s])}),e.next&&t.jsxs("div",{className:"gh-row",children:[t.jsx("button",{className:"btn pri",disabled:!0,children:e.next[s]}),t.jsx("span",{className:"gh-next",children:l.nextTag})]}),t.jsx(Vk,{label:e.label,lang:s}),t.jsx(Kk,{row:e,lang:s,open:!1,onCheck:i,checking:a})]}):t.jsxs(t.Fragment,{children:[e.state==="unknown"?t.jsx("p",{children:l.unknownLine(e.label)}):e.for&&t.jsx("p",{children:l.forWhat(e.for)}),m&&t.jsxs("div",{className:"gh-row",children:[t.jsx("button",{className:"btn pri",onClick:r,children:l.code.head(e.label)}),t.jsx(X,{text:m.command})]}),t.jsx(Kk,{row:e,lang:s,open:e.state==="missing"||e.state==="unknown",onCheck:i,checking:a})]}),c&&t.jsx(rH,{row:e,lang:s,onClose:()=>u(!1)})]})}function a6({name:e,label:n,onClose:s}){const r=Br(),i=ki[r],a=Ot(),{toast:l}=Le(),[c,u]=N.useState(null),[h,m]=N.useState(""),[p,x]=N.useState(0),g=N.useRef(!1),j=N.useRef(null),k=`/api/v1/connections/${encodeURIComponent(e)}/sign-in`,b=()=>void et(`${k}/cancel`,"POST").catch(()=>{});N.useEffect(()=>j.current?.focus(),[]),N.useEffect(()=>{let E=!1,z;const $=async()=>{if(!E)try{const P=await ye(k);if(E)return;u(P),P.state==="waiting"?z=setTimeout(()=>void $(),1500):P.state==="done"?(a.invalidateQueries(),l(ki[r].connectedNow(n)),s()):P.state==="cancelled"?s():P.state==="none"&&m(i.code.lost)}catch{E||(z=setTimeout(()=>void $(),3e3))}};return u(null),m(""),et(k,"POST").then(P=>{if(g.current)return b();E||(u(P),P.state==="waiting"&&(z=setTimeout(()=>void $(),1500)))}).catch(P=>!E&&m(P instanceof Error?P.message:String(P))),()=>{E=!0,z&&clearTimeout(z)}},[p]);const w=()=>{g.current||(g.current=!0,b(),s())};N.useEffect(()=>{const E=z=>z.key==="Escape"&&w();return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)});const S=()=>void navigator.clipboard?.writeText(c?.code??"").then(()=>l(i.code.copied),()=>l("Could not copy. Select the code instead.","err")),T=h||(c?.state==="failed"?c.line??i.code.lost:"");return t.jsx("div",{className:"modal-veil",children:t.jsxs("div",{ref:j,tabIndex:-1,className:"modal gh-code",role:"dialog","aria-modal":"true","aria-label":i.code.head(n),dir:r==="ar"?"rtl":"ltr",lang:r,children:[t.jsx("h2",{children:i.code.head(n)}),T?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"gh-bad",children:T}),t.jsxs("div",{className:"gh-row",children:[t.jsx("button",{className:"btn pri sm",onClick:()=>x(E=>E+1),children:i.code.again}),t.jsx("button",{className:"btn sm",onClick:w,children:i.code.close})]})]}):c?.code?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"gh-muted",children:i.code.sub(n)}),t.jsxs("div",{className:"gh-bigcode",dir:"ltr",children:[t.jsx("span",{"aria-label":"One-time code",children:c.code}),t.jsxs("button",{className:"btn sm",onClick:S,children:[t.jsx(Mn,{size:14})," ",i.code.copy]})]}),t.jsxs("p",{className:"gh-wait","aria-live":"polite",children:[t.jsx("span",{className:"gh-spin","aria-hidden":"true"}),i.code.wait(n)]}),t.jsxs("div",{className:"gh-row",children:[t.jsxs("a",{className:"btn sm",href:c.url,target:"_blank",rel:"noreferrer",children:[t.jsx(Xt,{size:14})," ",i.code.open(n)]}),t.jsx("button",{className:"btn sm",onClick:w,children:i.code.cancel}),t.jsx(X,{text:`squad connect ${e}`})]}),t.jsx("p",{className:"gh-foot",children:i.code.foot(n)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("p",{className:"gh-wait",children:[t.jsx("span",{className:"gh-spin","aria-hidden":"true"}),i.code.starting(n)]}),t.jsx("div",{className:"gh-row",children:t.jsx("button",{className:"btn sm",onClick:w,children:i.code.cancel})})]})]})})}function o6(e=3e4){return ve({queryKey:["connections"],queryFn:()=>ye("/api/v1/connections"),refetchInterval:e})}function aH(){const e=Br(),n=ki[e],s=o6(),r=Ot(),[i,a]=N.useState(null),[l,c]=N.useState(!1),u=()=>{c(!0),ye("/api/v1/connections?again=1").then(h=>r.setQueryData(["connections"],h)).finally(()=>c(!1))};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"top gh-top",dir:e==="ar"?"rtl":"ltr",lang:e,children:t.jsxs("div",{children:[t.jsx("h1",{children:n.head}),t.jsx("p",{children:n.sub})]})}),t.jsx("div",{className:"scroll",children:s.data?t.jsx("div",{className:"page gh-page",dir:e==="ar"?"rtl":"ltr",lang:e,children:t.jsx("div",{className:"gh-conns",children:s.data.rows.map((h,m)=>t.jsx(iH,{row:h,at:m,lang:e,onSignIn:()=>a(h),onCheck:u,checking:l},h.name))})}):s.isError?t.jsx(ys,{what:"the connections",error:s.error,onRetry:()=>void s.refetch()}):t.jsx("div",{className:"center",children:t.jsx(Xe,{size:16,className:"spin"})})}),i&&t.jsx(a6,{name:i.name,label:i.label,onClose:()=>a(null)})]})}function oH(){return ve({queryKey:["contribute"],queryFn:()=>ye("/api/v1/contribute"),refetchInterval:6e4})}function Yk({i:e}){return e!=="self"&&e.id==="idea"?t.jsx("span",{className:"as-dot tip","aria-hidden":"true",children:"?"}):e==="self"||e.state==="done"||e.state==="info"?t.jsx("span",{className:"as-dot ok","aria-hidden":"true",children:t.jsx(ce,{size:13,strokeWidth:2.8})}):t.jsx("span",{className:"as-dot todo","aria-hidden":"true"})}function lH({lang:e,command:n,onClose:s}){const r=JO[e],i=re(),[a,l]=N.useState(""),[c,u]=N.useState(""),[h,m]=N.useState("");return N.useEffect(()=>{const p=x=>x.key==="Escape"&&s();return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[s]),t.jsx("div",{className:"modal-veil",onMouseDown:p=>p.target===p.currentTarget&&s(),children:t.jsxs("div",{className:"modal gh-code",role:"dialog","aria-modal":"true","aria-label":r.head,dir:e==="ar"?"rtl":"ltr",lang:e,children:[t.jsx("h2",{children:r.head}),t.jsx("p",{className:"gh-muted",children:r.sub}),t.jsxs("div",{className:"as-idea",children:[t.jsxs("label",{children:[r.title,t.jsx("input",{className:"input",value:a,autoFocus:!0,onChange:p=>{l(p.target.value),m("")}})]}),t.jsxs("label",{children:[r.text,t.jsx("textarea",{className:"input",rows:4,value:c,onChange:p=>{u(p.target.value),m("")}})]})]}),h&&t.jsx("p",{className:"gh-muted",children:r.filled}),t.jsxs("div",{className:"gh-row",children:[h?t.jsxs("a",{className:"btn pri sm",href:h,target:"_blank",rel:"noreferrer",children:[t.jsx(Xt,{size:14})," ",r.open]}):t.jsx("button",{className:"btn pri sm",disabled:!a.trim()||i.isPending,onClick:()=>i.mutate({path:"/api/v1/contribute/idea",body:{title:a,text:c},after:p=>m(p.link)}),children:r.fill}),t.jsx("button",{className:"btn sm",onClick:s,children:e==="ar"?"إغلاق":"Close"}),t.jsx(X,{text:n})]})]})})}function cH(){const e=Br(),n=XO[e],s=oH(),r=re(),i=o6(6e4).data?.rows,[a,l]=N.useState(!1),[c,u]=N.useState(!1),[h,m]=N.useState(!1),p=s.data,x=e==="ar"?"rtl":"ltr",g=$=>r.mutate({path:$,done:P=>P.line}),j=i?.find($=>$.label===p?.host&&$.actions.some(P=>P.id==="sign-in")),k=p?.items.find($=>$.id==="sign-in")?.state==="done",b=p?.items.find($=>$.id==="copy")?.state==="todo",w=p?.left??0,S=!!p?.ready,T=k&&b&&w>=2,E=p?.items.find($=>$.id==="up-to-date"&&$.state==="blocked"&&$.count),z=($,P)=>{if(!P)return null;const L=$.state==="todo";if($.id==="sign-in")return j?t.jsx("button",{className:"btn pri sm",onClick:()=>m(!0),children:P}):t.jsx(ge,{to:"/connections",className:"btn pri sm",children:P});if($.id==="rules")return t.jsx("button",{className:"btn sm",onClick:()=>l(F=>!F),children:a?n.hide:P});if($.id==="idea")return t.jsx("button",{className:"btn sm",onClick:()=>u(!0),children:P});if(!$.action||$.state!=="todo")return null;const W=$.action.route.replace(/^POST /,"");return t.jsxs(t.Fragment,{children:[t.jsxs("button",{className:`btn sm ${L?"pri":""}`,disabled:r.isPending,onClick:()=>g(W),children:[r.isPending&&r.variables?.path===W?t.jsx(Xe,{size:13,className:"spin"}):null,P]}),t.jsx(X,{text:$.action.command})]})};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"top as-top",dir:x,lang:e,children:t.jsxs("div",{children:[t.jsx("h1",{children:n.head}),t.jsx("p",{children:n.sub})]})}),t.jsx("div",{className:"scroll",children:p?p.self?t.jsxs("div",{className:"page as-page",dir:x,lang:e,children:[t.jsxs("ol",{className:"as-checks",children:[t.jsxs("li",{children:[t.jsx(Yk,{i:"self"}),t.jsxs("div",{children:[t.jsx("b",{children:n.selfTitle}),t.jsx("p",{children:n.selfLine})]})]}),p.items.map($=>{const P=yk($,p,e);return t.jsxs("li",{className:$.state==="todo"||$.state==="blocked"?"todo":"",children:[t.jsx(Yk,{i:$}),t.jsxs("div",{children:[t.jsx("b",{children:P.title}),t.jsx("p",{children:P.line}),$.id==="rules"&&a&&t.jsxs("ul",{className:"as-rules",dir:"ltr",lang:"en",children:[$.points?.map(L=>t.jsx("li",{children:L},L)),$.file&&t.jsxs("li",{children:[n.readFile," ",t.jsx("code",{className:"mono",children:$.file})]})]})]}),t.jsx("span",{className:"as-act",children:z($,P.button)})]},$.id)})]}),t.jsxs("div",{className:"as-foot",children:[t.jsx("span",{className:"as-left",children:k?S?E&&p?yk(E,p,e).line:n.ready:n.left(w):n.signFirst}),T&&t.jsxs("button",{className:"btn pri",disabled:r.isPending,onClick:()=>g("/api/v1/contribute/setup"),children:[r.isPending&&r.variables?.path==="/api/v1/contribute/setup"?t.jsx(Xe,{size:14,className:"spin"}):null,n.both]}),S?t.jsx(ge,{to:"/board",search:{write:1},className:"btn pri",children:n.go}):t.jsx("button",{className:"btn",disabled:!0,children:n.go}),T&&t.jsx(X,{text:"squad contribute --fork --sync"})]})]}):t.jsx("div",{className:"page as-page",dir:x,lang:e,children:t.jsx("p",{className:"gh-muted",children:n.notSelf})}):s.isError?t.jsx(ys,{what:"the contribution checklist",error:s.error,onRetry:()=>void s.refetch()}):t.jsx("div",{className:"center",children:t.jsxs("span",{className:"gh-wait",children:[t.jsx(Xe,{size:16,className:"spin"})," ",n.looking]})})}),c&&t.jsx(lH,{lang:e,command:p?.items.find($=>$.id==="idea")?.action?.command??"squad contribute --idea <title>",onClose:()=>u(!1)}),h&&j&&t.jsx(a6,{name:j.name,label:j.label,onClose:()=>m(!1)})]})}const kt=j9({component:gt?s_:HW,beforeLoad:({location:e})=>{if(!gt&&e.pathname!=="/")throw jl({to:"/"})}}),dH=St({getParentRoute:()=>kt,path:"/",beforeLoad:()=>{if(gt)throw jl({to:"/overview"})}}),uH=St({getParentRoute:()=>kt,path:"/setup",component:xU}),hH=St({getParentRoute:()=>kt,path:"/overview",component:lU}),pH=St({getParentRoute:()=>kt,path:"/requirements",component:IU}),mH=St({getParentRoute:()=>kt,path:"/requirements/$id",validateSearch:e=>({item:typeof e.item=="string"&&e.item?e.item:void 0,view:e.view==="map"?"map":void 0,ticket:typeof e.ticket=="string"&&e.ticket?e.ticket:void 0,decided:e.decided===!0||e.decided==="true"?!0:void 0}),component:zU}),fH=St({getParentRoute:()=>kt,path:"/board",validateSearch:e=>({ticket:typeof e.ticket=="string"&&e.ticket?e.ticket:void 0,tab:e.tab==="story"||e.tab==="plan"||e.tab==="proof"?e.tab:void 0,view:e.view==="mine"||e.view==="bugs"?e.view:void 0,write:e.write===1||e.write==="1"?1:void 0}),component:WD}),gH=St({getParentRoute:()=>kt,path:"/tickets/$id/proof",component:VD}),xH=St({getParentRoute:()=>kt,path:"/backlog",component:JD}),yH=St({getParentRoute:()=>kt,path:"/inbox",component:OB}),jH=St({getParentRoute:()=>kt,path:"/releases",component:YD}),kH=St({getParentRoute:()=>kt,path:"/decisions",beforeLoad:()=>{throw jl({to:"/architecture",search:{view:"list"}})}}),vH=St({getParentRoute:()=>kt,path:"/architecture",validateSearch:e=>({adr:typeof e.adr=="string"&&e.adr?e.adr:void 0,view:["timeline","stack","list","project","lessons"].includes(e.view)?e.view:void 0}),component:tB}),bH=St({getParentRoute:()=>kt,path:"/conversations",validateSearch:e=>({ticket:typeof e.ticket=="string"&&e.ticket?e.ticket:void 0}),component:XW}),wH=St({getParentRoute:()=>kt,path:"/bugs",component:_B}),NH=St({getParentRoute:()=>kt,path:"/harness",validateSearch:e=>({tab:["compare","limits","safety","agents","additions"].includes(e.tab)?e.tab:void 0}),component:xW}),SH=St({getParentRoute:()=>kt,path:"/squad",beforeLoad:()=>{throw jl({to:"/harness",search:{tab:"agents"}})}}),CH=St({getParentRoute:()=>kt,path:"/settings",component:eW}),$H=St({getParentRoute:()=>kt,path:"/tools",component:GO}),TH=St({getParentRoute:()=>kt,path:"/connections",component:aH}),EH=St({getParentRoute:()=>kt,path:"/contribute",component:cH}),AH=St({getParentRoute:()=>kt,path:"/lead",validateSearch:e=>({c:typeof e.c=="string"&&/^[\w-]{1,64}$/.test(e.c)?e.c:void 0}),component:ZU}),PH=kt.addChildren([dH,uH,hH,pH,mH,fH,xH,gH,yH,bH,jH,kH,vH,wH,NH,SH,$H,TH,EH,AH,CH]),RH=A9({routeTree:PH,defaultPreload:!1,basepath:ga||"/",defaultErrorComponent:o5}),qH=2e3;function IH(){const e=T5(),n=Ot();N.useEffect(()=>{const r=()=>{fetch("/healthz",{cache:"no-store"}).then(()=>F9(),()=>zv())},i=window.setInterval(r,qH);return()=>window.clearInterval(i)},[]);const s=N.useRef(e);return N.useEffect(()=>{e==="down"?document.documentElement.dataset.appDown="1":delete document.documentElement.dataset.appDown,e==="up"&&s.current!=="up"&&n.invalidateQueries(),s.current=e},[e,n]),e==="up"?null:t.jsxs("div",{className:"appdown",role:"alert",children:[t.jsx("span",{className:"upd-ic",children:t.jsx(Is,{size:16})}),t.jsx("div",{className:"upd-main",children:e==="down"?t.jsxs(t.Fragment,{children:[t.jsx("b",{className:"upd-title",children:"squad-kit has stopped, so this page is not up to date"}),t.jsx("span",{className:"upd-sub",children:"Your work and what you typed are safe. Start it again in a terminal. This page comes back by itself."})]}):t.jsxs(t.Fragment,{children:[t.jsx("b",{className:"upd-title",children:"This page's link is out of date"}),t.jsx("span",{className:"upd-sub",children:"Run this in a terminal: it opens the board with a fresh link. What you typed is kept."})]})}),t.jsx("div",{className:"upd-acts",children:t.jsx(X,{text:"squad"})})]})}document.documentElement.dataset.theme=cb();const FH=new M8({defaultOptions:{queries:{staleTime:500,retry:1,refetchOnWindowFocus:!0}}}),l6=document.getElementById("root");if(!l6)throw new Error("missing #root");const LH=O9();F$();d8.createRoot(l6).render(t.jsx(N.StrictMode,{children:LH?t.jsx(O8,{client:FH,children:t.jsxs(Pj,{children:[t.jsx(IH,{}),t.jsx(jk,{children:t.jsx(q9,{router:RH})}),t.jsx(jk,{fallback:null,children:t.jsx(pz,{})})]})}):t.jsx(Pj,{children:t.jsx("div",{className:"center",style:{height:"100%"},children:t.jsxs("div",{style:{maxWidth:460},children:[t.jsx("h2",{children:"Open squad-kit once from a terminal"}),t.jsx("p",{children:"This browser has not opened squad-kit yet, so it does not have its private link. Run this in a terminal: it opens the board here, and after that new tabs and bookmarks work too."}),t.jsx(X,{text:"squad"})]})})})}));